gate: API startup resilient to RLS errors, dont fail on duplicate cron job inserts

This commit is contained in:
Agent Zero
2026-07-31 09:33:41 +02:00
parent 31d11efd33
commit 01aa31a3e0
+4 -1
View File
@@ -230,9 +230,12 @@ async def lifespan(app: FastAPI):
# Flush to detect any RLS errors that were swallowed by the plugin
await db.flush()
except Exception as exc:
# RLS may block duplicate cron job inserts — rollback and continue
# The cron jobs are already registered from previous startups
logger.warning(f"[STARTUP] Plugin {name} activation issue for tenant {tenant_id}: {exc}")
await db.rollback()
activation_failed = True
# Don't set activation_failed — the plugin's event handlers are still registered
# and the cron jobs already exist in the DB from previous startups
break
if not activation_failed: