Files
romm/backend/utils/sentry.py
Claude 103c59e9c0 fix: keep a consumer on the streaming queue when streaming is off
config.yml is re-read on every request, so streaming can be turned on
without a restart, and exit save pulls queued before it was turned off
still need a worker. With streaming off at boot, the general RQ worker
now listens on the streaming queue too instead of leaving it without a
consumer; the dedicated streaming worker still starts only when
streaming is on.

The check reads the exit status inline rather than through a function
in an `if !`, which shellcheck flags (SC2310) since it disables errexit.

Adds a fresh-interpreter test that init_sentry() never imports the SDK
without a DSN, and drops a comment that restated the PR's rationale.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Gh1SRMfuK7BZmf6YxMqSyT
2026-10-01 01:40:44 +00:00

14 lines
353 B
Python

from config import SENTRY_DSN
from utils import get_version
def init_sentry() -> None:
"""Start Sentry error reporting when a DSN is configured."""
if not SENTRY_DSN:
return
# Imported here so a process without a DSN never loads the SDK.
import sentry_sdk
sentry_sdk.init(dsn=SENTRY_DSN, release=f"romm@{get_version()}")