REDROOM
PHP 8.3.31
Path:
Logout
Edit File
Size: 972 B
Close
//opt/hc_python/lib64/python3.12/site-packages/sentry_sdk/integrations/celery/utils.py
Text
Base64
import time from typing import TYPE_CHECKING, cast if TYPE_CHECKING: from typing import Tuple from sentry_sdk._types import MonitorConfigScheduleUnit def _now_seconds_since_epoch() -> float: # We cannot use `time.perf_counter()` when dealing with the duration # of a Celery task, because the start of a Celery task and # the end are recorded in different processes. # Start happens in the Celery Beat process, # the end in a Celery Worker process. return time.time() def _get_humanized_interval(seconds: float) -> "Tuple[int, MonitorConfigScheduleUnit]": TIME_UNITS = ( # noqa: N806 ("day", 60 * 60 * 24.0), ("hour", 60 * 60.0), ("minute", 60.0), ) seconds = float(seconds) for unit, divider in TIME_UNITS: if seconds >= divider: interval = int(seconds / divider) return (interval, cast("MonitorConfigScheduleUnit", unit)) return (int(seconds), "second")
Save
Close
Exit & Reset
Text mode: syntax highlighting auto-detects file type.
Directory Contents
Dirs: 1 × Files: 3
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
beat.py
8.63 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
utils.py
972 B
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
21.96 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).