@@ -854,24 +854,24 @@ func (m *RpcServer) GetTask(cxt context.Context, req *pb.GetTaskRequest) (*pb.Ge
854854 m .logMethod ()
855855 defer m .logMethodHandled ()
856856
857- task := m .state .taskman .GetTask (req .TaskId )
858- if task == nil {
857+ requestedTask := m .state .taskman .GetTask (req .TaskId )
858+ if requestedTask == nil {
859859 return & pb.GetTaskReply {Timestamp : currentUnixMilli ()}, status .New (codes .NotFound , "task not found" ).Err ()
860860 }
861- taskClass := task .GetTaskClass ()
862- commandInfo := task .GetTaskCommandInfo ()
861+ taskClass := requestedTask .GetTaskClass ()
862+ commandInfo := requestedTask .GetTaskCommandInfo ()
863863 var outbound []channel.Outbound
864864 var inbound []channel.Inbound
865865 taskPath := ""
866866 // TODO: probably not the nicest way to do this... the outbound assignments should be cached
867867 // in the Task
868- if task .IsLocked () {
868+ if requestedTask .IsLocked () {
869869 type parentRole interface {
870870 CollectOutboundChannels () []channel.Outbound
871871 GetPath () string
872872 CollectInboundChannels () []channel.Inbound
873873 }
874- parent , ok := task .GetParentRole ().(parentRole )
874+ parent , ok := requestedTask .GetParentRole ().(parentRole )
875875 if ok {
876876 outbound = channel .MergeOutbound (parent .CollectOutboundChannels (), taskClass .Connect )
877877 taskPath = parent .GetPath ()
@@ -885,13 +885,13 @@ func (m *RpcServer) GetTask(cxt context.Context, req *pb.GetTaskRequest) (*pb.Ge
885885
886886 rep := & pb.GetTaskReply {
887887 Task : & pb.TaskInfo {
888- ShortInfo : taskToShortTaskInfo (task , m .state .taskman ),
888+ ShortInfo : taskToShortTaskInfo (requestedTask , m .state .taskman ),
889889 InboundChannels : inboundChannelsToPbChannels (inbound ),
890890 OutboundChannels : outboundChannelsToPbChannels (outbound ),
891891 CommandInfo : commandInfoToPbCommandInfo (commandInfo ),
892892 TaskPath : taskPath ,
893- EnvId : task .GetEnvironmentId ().String (),
894- Properties : task .GetProperties (),
893+ EnvId : requestedTask .GetEnvironmentId ().String (),
894+ Properties : requestedTask .GetProperties (),
895895 },
896896 Timestamp : currentUnixMilli (),
897897 }
0 commit comments