@@ -860,24 +860,24 @@ func (m *RpcServer) GetTask(cxt context.Context, req *pb.GetTaskRequest) (*pb.Ge
860860 m .logMethod ()
861861 defer m .logMethodHandled ()
862862
863- task := m .state .taskman .GetTask (req .TaskId )
864- if task == nil {
863+ requestedTask := m .state .taskman .GetTask (req .TaskId )
864+ if requestedTask == nil {
865865 return & pb.GetTaskReply {Timestamp : currentUnixMilli ()}, status .New (codes .NotFound , "task not found" ).Err ()
866866 }
867- taskClass := task .GetTaskClass ()
868- commandInfo := task .GetTaskCommandInfo ()
867+ taskClass := requestedTask .GetTaskClass ()
868+ commandInfo := requestedTask .GetTaskCommandInfo ()
869869 var outbound []channel.Outbound
870870 var inbound []channel.Inbound
871871 taskPath := ""
872872 // TODO: probably not the nicest way to do this... the outbound assignments should be cached
873873 // in the Task
874- if task .IsLocked () {
874+ if requestedTask .IsLocked () {
875875 type parentRole interface {
876876 CollectOutboundChannels () []channel.Outbound
877877 GetPath () string
878878 CollectInboundChannels () []channel.Inbound
879879 }
880- parent , ok := task .GetParentRole ().(parentRole )
880+ parent , ok := requestedTask .GetParentRole ().(parentRole )
881881 if ok {
882882 outbound = channel .MergeOutbound (parent .CollectOutboundChannels (), taskClass .Connect )
883883 taskPath = parent .GetPath ()
@@ -891,13 +891,13 @@ func (m *RpcServer) GetTask(cxt context.Context, req *pb.GetTaskRequest) (*pb.Ge
891891
892892 rep := & pb.GetTaskReply {
893893 Task : & pb.TaskInfo {
894- ShortInfo : taskToShortTaskInfo (task , m .state .taskman ),
894+ ShortInfo : taskToShortTaskInfo (requestedTask , m .state .taskman ),
895895 InboundChannels : inboundChannelsToPbChannels (inbound ),
896896 OutboundChannels : outboundChannelsToPbChannels (outbound ),
897897 CommandInfo : commandInfoToPbCommandInfo (commandInfo ),
898898 TaskPath : taskPath ,
899- EnvId : task .GetEnvironmentId ().String (),
900- Properties : task .GetProperties (),
899+ EnvId : requestedTask .GetEnvironmentId ().String (),
900+ Properties : requestedTask .GetProperties (),
901901 },
902902 Timestamp : currentUnixMilli (),
903903 }
0 commit comments