gate: wrap db.commit() in try/except after plugin activation
This commit is contained in:
+5
-1
@@ -241,7 +241,11 @@ async def lifespan(app: FastAPI):
|
||||
plugin_record.status = "active"
|
||||
logger.info(f"[STARTUP] Activated plugin: {name}")
|
||||
|
||||
await db.commit()
|
||||
try:
|
||||
await db.commit()
|
||||
except Exception as exc:
|
||||
logger.warning(f"[STARTUP] Commit failed after plugin activation: {exc}")
|
||||
await db.rollback()
|
||||
|
||||
# Initialize permission registry with active plugin names
|
||||
from app.core.permission_registry import init_permission_registry, register_plugin_permissions
|
||||
|
||||
Reference in New Issue
Block a user