Skip to content

Commit ea1d033

Browse files
committed
Drop redundant instance select with lock
1 parent 13b4525 commit ea1d033

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/dstack/_internal/server/background/pipeline_tasks/jobs_submitted.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -832,9 +832,10 @@ async def _lock_assignment_fleet_for_existing_instance_assignment(
832832
if not instance_ids:
833833
return None
834834

835-
if is_db_sqlite():
836-
await sqlite_commit(session)
835+
if not is_db_sqlite():
836+
return fleets_with_instances[0]
837837

838+
await sqlite_commit(session)
838839
await exit_stack.enter_async_context(
839840
get_locker(get_db().dialect_name).lock_ctx(InstanceModel.__tablename__, instance_ids)
840841
)

0 commit comments

Comments
 (0)