REDROOM
PHP 8.3.31
Path:
Logout
Edit File
Size: 1.58 KB
Close
/opt/hc_python/lib64/python3.12/site-packages/sentry_sdk/integrations/django/tasks.py
Text
Base64
from functools import wraps import sentry_sdk from sentry_sdk.consts import OP from sentry_sdk.tracing_utils import has_span_streaming_enabled from sentry_sdk.utils import qualname_from_function try: # django.tasks were added in Django 6.0 from django.tasks.base import Task except ImportError: Task = None from typing import TYPE_CHECKING if TYPE_CHECKING: from typing import Any def patch_tasks() -> None: if Task is None: return old_task_enqueue = Task.enqueue @wraps(old_task_enqueue) def _sentry_enqueue(self: "Any", *args: "Any", **kwargs: "Any") -> "Any": from sentry_sdk.integrations.django import DjangoIntegration integration = sentry_sdk.get_client().get_integration(DjangoIntegration) if integration is None: return old_task_enqueue(self, *args, **kwargs) name = qualname_from_function(self.func) or "<unknown Django task>" span_streaming = has_span_streaming_enabled(sentry_sdk.get_client().options) if span_streaming: with sentry_sdk.traces.start_span( name=name, attributes={ "sentry.op": OP.QUEUE_SUBMIT_DJANGO, "sentry.origin": DjangoIntegration.origin, }, ): return old_task_enqueue(self, *args, **kwargs) else: with sentry_sdk.start_span( op=OP.QUEUE_SUBMIT_DJANGO, name=name, origin=DjangoIntegration.origin ): return old_task_enqueue(self, *args, **kwargs) Task.enqueue = _sentry_enqueue
Save
Close
Exit & Reset
Text mode: syntax highlighting auto-detects file type.
Directory Contents
Dirs: 1 × Files: 9
Delete Selected
Select All
Select None
Sort:
Name
Size
Modified
Enable drag-to-move
Name
Size
Perms
Modified
Actions
__pycache__
DIR
-
drwxr-xr-x
2026-06-11 06:30:31
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
asgi.py
9.04 KB
lrw-r--r--
2026-06-11 06:30:31
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
caching.py
9.37 KB
lrw-r--r--
2026-06-11 06:30:31
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
middleware.py
6.40 KB
lrw-r--r--
2026-06-11 06:30:31
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
signals_handlers.py
3.71 KB
lrw-r--r--
2026-06-11 06:30:31
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
tasks.py
1.58 KB
lrw-r--r--
2026-06-11 06:30:31
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
templates.py
6.60 KB
lrw-r--r--
2026-06-11 06:30:31
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
transactions.py
4.68 KB
lrw-r--r--
2026-06-11 06:30:31
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
views.py
4.46 KB
lrw-r--r--
2026-06-11 06:30:31
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
__init__.py
28.25 KB
lrw-r--r--
2026-06-11 06:30:31
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
Zip Selected
If ZipArchive is unavailable, a
.tar
will be created (no compression).