diff --git a/app/main.py b/app/main.py index c4c04b5..fde5aec 100644 --- a/app/main.py +++ b/app/main.py @@ -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: