Skip to content

Commit 3ad70b0

Browse files
authored
Update and cleanup Celery integration (#2891)
Cleanup the Celery integration to make it easier to work on it and also update to the new minimum supported Celery versions and the new Scopes API.
1 parent cf5a94f commit 3ad70b0

File tree

7 files changed

+760
-700
lines changed

7 files changed

+760
-700
lines changed

sentry_sdk/crons/api.py

+3-4
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import uuid
22

3-
from sentry_sdk import Hub
3+
import sentry_sdk
44
from sentry_sdk._types import TYPE_CHECKING
55

66

@@ -17,7 +17,7 @@ def _create_check_in_event(
1717
monitor_config=None,
1818
):
1919
# type: (Optional[str], Optional[str], Optional[str], Optional[float], Optional[Dict[str, Any]]) -> Event
20-
options = Hub.current.client.options if Hub.current.client else {}
20+
options = sentry_sdk.get_client().options
2121
check_in_id = check_in_id or uuid.uuid4().hex # type: str
2222

2323
check_in = {
@@ -52,7 +52,6 @@ def capture_checkin(
5252
monitor_config=monitor_config,
5353
)
5454

55-
hub = Hub.current
56-
hub.capture_event(check_in_event)
55+
sentry_sdk.capture_event(check_in_event)
5756

5857
return check_in_event["check_in_id"]

0 commit comments

Comments
 (0)