Skip DB registration in standalone mode (fixes sx-web.org startup)
All checks were successful
Build and Deploy / build-and-deploy (push) Successful in 4m5s

The sx app is stateless — no database needed. In standalone mode
(SX_STANDALONE=true), the factory now skips register_db() so the app
doesn't crash trying to connect to a non-existent PostgreSQL.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-03-05 16:53:05 +00:00
parent 6a98c39937
commit 9cde15c3ce
2 changed files with 4 additions and 1 deletions

View File

@@ -48,6 +48,7 @@ def create_base_app(
before_request_fns: Sequence[Callable[[], Awaitable[None]]] | None = None,
domain_services_fn: Callable[[], None] | None = None,
no_oauth: bool = False,
no_db: bool = False,
) -> Quart:
"""
Create a Quart app with shared infrastructure.
@@ -111,7 +112,8 @@ def create_base_app(
# --- infrastructure ---
register_middleware(app)
register_db(app)
if not no_db:
register_db(app)
register_redis(app)
setup_jinja(app)
setup_sx_bridge(app)

View File

@@ -58,6 +58,7 @@ def create_app() -> "Quart":
extra_kw = {}
if SX_STANDALONE:
extra_kw["no_oauth"] = True
extra_kw["no_db"] = True
app = create_base_app(
"sx",