gate: worker flush after plugin activation to detect swallowed RLS errors
This commit is contained in:
+3
-1
@@ -147,10 +147,12 @@ async def on_startup(ctx: dict[str, Any]) -> None:
|
||||
try:
|
||||
await set_tenant_context(db, tenant_id)
|
||||
await plugin.on_activate(db, container, event_bus)
|
||||
# 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 the API container startup
|
||||
logger.warning(f"Worker: plugin {name} activation failed for tenant {tenant_id}: {exc}")
|
||||
logger.warning(f"Worker: plugin {name} activation issue for tenant {tenant_id}: {exc}")
|
||||
await db.rollback()
|
||||
activation_failed = True
|
||||
break
|
||||
|
||||
Reference in New Issue
Block a user