test(openspec): map cloud integration scenarios
This commit is contained in:
@@ -59,11 +59,22 @@ class SQLAlchemyCloudRepository:
|
||||
self,
|
||||
host_id: str,
|
||||
devices: list[Any],
|
||||
*,
|
||||
allow_device_takeover: bool = False,
|
||||
) -> None:
|
||||
with self._sessions.begin() as session:
|
||||
session.execute(
|
||||
delete(PooledDeviceRow).where(PooledDeviceRow.host_id == host_id)
|
||||
)
|
||||
if allow_device_takeover:
|
||||
device_ids = [device.device_id for device in devices]
|
||||
if device_ids:
|
||||
session.execute(
|
||||
delete(PooledDeviceRow).where(
|
||||
PooledDeviceRow.host_id != host_id,
|
||||
PooledDeviceRow.device_id.in_(device_ids),
|
||||
)
|
||||
)
|
||||
session.add_all(
|
||||
[
|
||||
PooledDeviceRow(
|
||||
|
||||
Reference in New Issue
Block a user