fix: flush upload job before child items

This commit is contained in:
hailt 2026-11-12 22:47:55 +07:00
parent 5a546e4e40
commit cc9129e7dd

View file

@ -35,6 +35,7 @@ async def create_job(project_id: str, kind: str, files: list[dict], db: AsyncSes
job = UploadJob(id=uuid.uuid4().hex[:12], project_id=project_id,
kind=kind or "images", total_files=len(files))
db.add(job)
await db.flush()
items = []
for f in files:
item_id = uuid.uuid4().hex[:12]