Skip to content

Commit 8051e85

Browse files
committed
Fix FOR UPDATE with nullable join
1 parent 236b731 commit 8051e85

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
from sqlalchemy import select, update
77
from sqlalchemy.ext.asyncio import AsyncSession
8-
from sqlalchemy.orm import joinedload, load_only
8+
from sqlalchemy.orm import joinedload, load_only, selectinload
99

1010
from dstack._internal.core.models.fleets import FleetSpec, FleetStatus
1111
from dstack._internal.core.models.instances import InstanceStatus
@@ -56,7 +56,7 @@ async def process_fleets():
5656
)
5757
.options(
5858
load_only(FleetModel.id, FleetModel.name),
59-
joinedload(FleetModel.instances).load_only(InstanceModel.id),
59+
selectinload(FleetModel.instances).load_only(InstanceModel.id),
6060
)
6161
.order_by(FleetModel.last_processed_at.asc())
6262
.limit(BATCH_SIZE)

0 commit comments

Comments
 (0)