Skip to content

Commit eec2d26

Browse files
committed
Remove extra selectin
1 parent 52be077 commit eec2d26

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/dstack/_internal/server/background/tasks/process_runs.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,9 +95,10 @@ async def _process_next_run():
9595
),
9696
),
9797
)
98+
.options(joinedload(RunModel.jobs).load_only(JobModel.id))
9899
.order_by(RunModel.last_processed_at.asc())
99100
.limit(1)
100-
.with_for_update(skip_locked=True, key_share=True)
101+
.with_for_update(skip_locked=True, key_share=True, of=RunModel)
101102
)
102103
run_model = res.scalar()
103104
if run_model is None:

0 commit comments

Comments
 (0)