Skip to content

Commit

Permalink
continue redefining what finished/completed scan is - 2
Browse files Browse the repository at this point in the history
  • Loading branch information
ric-evans committed Jan 29, 2025
1 parent 8a43972 commit 978b5e8
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions skydriver/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import enum

from rest_tools.client import RestClient
from tornado import web

from . import database, ewms
from .database.schema import DEPRECATED_EWMS_TASK, Manifest, PENDING_EWMS_WORKFLOW
Expand Down Expand Up @@ -37,9 +38,14 @@ async def get_scan_state(
Returns the state as a human-readable string
"""
if (await results.get(manifest.scan_id)).is_final:
# NOTE: see note on 'SCAN_HAS_FINAL_RESULT' above
return _ScanState.SCAN_HAS_FINAL_RESULT.name
try:
if (await results.get(manifest.scan_id)).is_final:
# NOTE: see note on 'SCAN_HAS_FINAL_RESULT' above
return _ScanState.SCAN_HAS_FINAL_RESULT.name
except web.HTTPError as e:
# get() raises 404 when no result found
if e.status_code != 404:
raise

def _has_cleared_backlog() -> bool:
return bool(
Expand Down

0 comments on commit 978b5e8

Please sign in to comment.