diff --git a/app/core/worker.py b/app/core/worker.py index 430716c..053b5bc 100644 --- a/app/core/worker.py +++ b/app/core/worker.py @@ -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