diff --git a/prestart.sh b/prestart.sh index cf27e81..8f4284e 100644 --- a/prestart.sh +++ b/prestart.sh @@ -111,14 +111,15 @@ echo "[prestart] Auto-installing and activating discovered plugins..." python3 -c " import asyncio from app.plugins.registry import get_registry -from app.core.db import async_session_factory +from app.core.db import get_session_factory from sqlalchemy import select from app.models.plugin import Plugin as PluginModel async def auto_activate_plugins(): r = get_registry() discovered = r.discover_builtins() - async with async_session_factory() as db: + factory = get_session_factory() + async with factory() as db: for name in discovered: result = await db.execute(select(PluginModel).where(PluginModel.name == name)) record = result.scalar_one_or_none()