Skip to content

Commit 52be077

Browse files
committed
Select for update with of=InstanceModel
1 parent b19465a commit 52be077

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,7 @@ async def _process_next_instance():
160160
.options(joinedload(InstanceModel.project).load_only(ProjectModel.ssh_private_key))
161161
.order_by(InstanceModel.last_processed_at.asc())
162162
.limit(1)
163-
.with_for_update(skip_locked=True, key_share=True)
163+
.with_for_update(skip_locked=True, key_share=True, of=InstanceModel)
164164
)
165165
instance = res.scalar()
166166
if instance is None:

0 commit comments

Comments
 (0)