fix: flush upload job before child items
This commit is contained in:
parent
5a546e4e40
commit
cc9129e7dd
1 changed files with 1 additions and 0 deletions
|
|
@ -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,
|
job = UploadJob(id=uuid.uuid4().hex[:12], project_id=project_id,
|
||||||
kind=kind or "images", total_files=len(files))
|
kind=kind or "images", total_files=len(files))
|
||||||
db.add(job)
|
db.add(job)
|
||||||
|
await db.flush()
|
||||||
items = []
|
items = []
|
||||||
for f in files:
|
for f in files:
|
||||||
item_id = uuid.uuid4().hex[:12]
|
item_id = uuid.uuid4().hex[:12]
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue