Skip to content

Commit

Permalink
fix(opentelemetry-instrumentation-celery): attach context only if it …
Browse files Browse the repository at this point in the history
…is not None
  • Loading branch information
malcolmrebughini authored and ocelotl committed Aug 1, 2024
1 parent 5659993 commit a92816a
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ def _trace_prerun(self, *args, **kwargs):
self.update_task_duration_time(task_id)
request = task.request
tracectx = extract(request, getter=celery_getter) or None
token = context_api.attach(tracectx)
token = context_api.attach(tracectx) if tracectx is not None else None

logger.debug("prerun signal start task_id=%s", task_id)

Expand Down

0 comments on commit a92816a

Please sign in to comment.