v0.22.1: dockerize defaults, harden error handling, fix test discovery
- config.py: defaults to localhost/localhost, AMQP to rabbitmq, secret path to /run/secrets, RAG_MAX_VECTORS from env - rag.py: EMBED_URL default to localhost - app.py: syslog handler wrapped in try/except - routers/completions.py: db.close() in try/finally - db.py: PRAGMA journal_mode = WAL - amqp.py: subscription append before try for reconnect safety - tests/conftest.py: add project root to sys.path for test discovery
This commit is contained in:
@@ -43,6 +43,8 @@ async def subscribe(exchange: str, routing_keys: list[str], handler) -> None:
|
||||
if ch is None:
|
||||
log.error("cannot subscribe — no AMQP channel")
|
||||
return
|
||||
# Track subscription before attempting so reconnect catches it even if this try fails
|
||||
_subscriptions.append((exchange, routing_keys, handler))
|
||||
try:
|
||||
queue = await ch.declare_queue("", exclusive=True)
|
||||
ex = await ch.get_exchange(exchange)
|
||||
@@ -58,7 +60,6 @@ async def subscribe(exchange: str, routing_keys: list[str], handler) -> None:
|
||||
log.exception("AMQP handler error for %s %s", exchange, msg.routing_key)
|
||||
|
||||
await queue.consume(_dispatch)
|
||||
_subscriptions.append((exchange, routing_keys, handler))
|
||||
except Exception:
|
||||
log.exception("AMQP subscribe failed for %s %s", exchange, routing_keys)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user