diff --git a/cloud/tasks/scheduler_impl.go b/cloud/tasks/scheduler_impl.go index 30976251f4c..f108f5a3cba 100644 --- a/cloud/tasks/scheduler_impl.go +++ b/cloud/tasks/scheduler_impl.go @@ -153,9 +153,11 @@ func (s *scheduler) ScheduleRegularTasks( continue } - ctx = headers.SetIncomingRequestID(ctx, requestID.String()) - ctx = tracing.SetTracingContext(ctx) - metadata := tasks_storage.NewMetadata(headers.GetTracingHeaders(ctx)) + metadataCtx := headers.SetIncomingRequestID(ctx, requestID.String()) + metadataCtx = tracing.SetTracingContext(metadataCtx) + metadata := tasks_storage.NewMetadata( + headers.GetTracingHeaders(metadataCtx), + ) schedule := tasks_storage.TaskSchedule{ ScheduleInterval: schedule.ScheduleInterval,