feat: use no refresh flag in job creation (#3434)

This commit is contained in:
cthomas
2025-07-20 14:29:19 -07:00
committed by GitHub
parent 6fbd5bcdd0
commit a95ff6f5c5

View File

@@ -62,8 +62,10 @@ class JobManager:
pydantic_job.user_id = actor.id
job_data = pydantic_job.model_dump(to_orm=True)
job = JobModel(**job_data)
await job.create_async(session, actor=actor) # Save job in the database
return job.to_pydantic()
job = await job.create_async(session, actor=actor, no_commit=True, no_refresh=True) # Save job in the database
result = job.to_pydantic()
await session.commit()
return result
@enforce_types
@trace_method