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
Skip sentry_sdk.init when no SENTRY_DSN is set. Without a DSN the SDK
reports nothing, yet init still loads every default integration (httpx,
rich, jinja2, mako, pygments...), about 10 MB per process.
Import alembic.config only in main.py's __main__ block, the one place
that uses it, instead of in every gunicorn worker (about 8 MB).
Don't start the RQ streaming worker when config.yml leaves streaming
off (the default). It only runs streaming teardowns and exit save pulls,
and costs about 115 MB idle.
Measured on a gunicorn worker importing main: 213 MB -> 193 MB RSS.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Gh1SRMfuK7BZmf6YxMqSyT