Skip to content

Commit

Permalink
Fix issue disabling a tile
Browse files Browse the repository at this point in the history
  • Loading branch information
albireox committed Sep 26, 2024
1 parent 0f6701f commit 64a6f8d
Showing 1 changed file with 11 additions and 10 deletions.
21 changes: 11 additions & 10 deletions src/gort/gort.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@
kubernetes_list_deployments,
kubernetes_restart_deployment,
run_in_executor,
set_tile_status,
)


Expand Down Expand Up @@ -711,17 +712,17 @@ async def observe(
raise

if ee.error_code == ErrorCode.ACQUISITION_FAILED:
observer: GortObserver | None = ee.payload.get("observer", None)
if observer is None:
self.log.error('Cannot disable tile: "observer" not found.')
raise
if observer.tile.tile_id is None:
self.log.error('Cannot disable tile without a "tile_id".')
raise

await observer.tile.disable()
tile_id: int | None = ee.payload.get("tile_id", None)
if tile_id is None:
self.log.error(
'Cannot disable tile without a "tile_id. '
"Continuing observations without disabling tile."
)
continue

await set_tile_status(tile_id, enabled=False)
self.log.warning(
f"tile_id={observer.tile.tile_id} has been disabled. "
f"tile_id={tile_id} has been disabled. "
"Continuing observations."
)

Expand Down

0 comments on commit 64a6f8d

Please sign in to comment.