fix(capture): every process registers every table before its first query
The models now live in their units' packages, and a core model names a unit's by string (User.subscriptions -> Subscription). The download child imports neither catalog nor app.tables before db.get, so mapper configuration failed and every download, clip, edit and upload job died with child_exit. Each entry point now imports app.tables, and a test imports each one in a clean interpreter.
This commit is contained in:
@@ -24,6 +24,7 @@ sys.path.insert(0, "/app")
|
||||
from sqlalchemy import delete, func, select
|
||||
|
||||
from app.db import SessionLocal
|
||||
import app.tables # noqa: F401 — every table, before the first query
|
||||
from app.catalog.models import Channel, Subscription, Video
|
||||
from app.models import AppState, User
|
||||
from app.reader.models import Playlist, PlaylistItem, VideoState
|
||||
|
||||
Reference in New Issue
Block a user