fix: prestart.sh uses get_session_factory instead of non-existent async_session_factory
This commit is contained in:
+3
-2
@@ -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()
|
||||
|
||||
Reference in New Issue
Block a user