Skip to content

Commit 98b8d24

Browse files
committed
More cleanup
1 parent 1610301 commit 98b8d24

File tree

2 files changed

+3
-5
lines changed

2 files changed

+3
-5
lines changed

sentry_sdk/integrations/celery/__init__.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -307,8 +307,8 @@ def _inner(*args, **kwargs):
307307
with isolation_scope() as scope:
308308
scope._name = "celery"
309309
scope.clear_breadcrumbs()
310-
scope.add_event_processor(_make_event_processor(task, *args, **kwargs))
311310
scope.set_transaction_name(task.name, source=TRANSACTION_SOURCE_TASK)
311+
scope.add_event_processor(_make_event_processor(task, *args, **kwargs))
312312

313313
# Celery task objects are not a thing to be trusted. Even
314314
# something such as attribute access can fail.
@@ -515,8 +515,6 @@ def sentry_publish(self, *args, **kwargs):
515515
SPANDATA.MESSAGING_SYSTEM, self.connection.transport.driver_type
516516
)
517517

518-
return_value = original_publish(self, *args, **kwargs)
519-
520-
return return_value
518+
return original_publish(self, *args, **kwargs)
521519

522520
Producer.publish = sentry_publish

tests/integrations/celery/test_celery.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -191,7 +191,7 @@ def dummy_task(x, y):
191191
return x / y
192192

193193
# XXX: For some reason the first call does not get instrumented properly.
194-
celery_invocation(dummy_task, 1, 1)
194+
# celery_invocation(dummy_task, 1, 1)
195195

196196
events = capture_events()
197197

0 commit comments

Comments
 (0)