Fix #1: SELECT FOR UPDATE on task_counter to prevent race condition
Some checks failed
Deploy Tracker / deploy (push) Failing after 5s
Some checks failed
Deploy Tracker / deploy (push) Failing after 5s
This commit is contained in:
parent
c7b073b36c
commit
5e3ec5e7c5
@ -227,7 +227,9 @@ async def create_task(
|
||||
current_member: Member = Depends(get_current_member),
|
||||
db: AsyncSession = Depends(get_db),
|
||||
):
|
||||
result = await db.execute(select(Project).where(Project.slug == project_slug))
|
||||
result = await db.execute(
|
||||
select(Project).where(Project.slug == project_slug).with_for_update()
|
||||
)
|
||||
project = result.scalar_one_or_none()
|
||||
if not project:
|
||||
raise HTTPException(404, "Project not found")
|
||||
|
||||
Loading…
Reference in New Issue
Block a user