Skip to content

Commit

Permalink
Merge pull request #287 from lsst-sqre/tickets/DM-45818
Browse files Browse the repository at this point in the history
DM-45818: Fix UWS Availability during errors
  • Loading branch information
rra authored Aug 16, 2024
2 parents 83586c4 + 083cf87 commit d8e4559
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
3 changes: 3 additions & 0 deletions changelog.d/20240816_105321_rra_DM_45818.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
### Bug fixes

- Fix construction of an `Availability` object reporting problems with the UWS database layer to use the correct field names and data type for the model.
4 changes: 2 additions & 2 deletions safir/src/safir/uws/_storage.py
Original file line number Diff line number Diff line change
Expand Up @@ -163,10 +163,10 @@ async def availability(self) -> Availability:
return Availability(available=True)
except OperationalError:
note = "cannot query UWS job database"
return Availability(available=False, note=note)
return Availability(available=False, notes=[note])
except Exception as e:
note = f"{type(e).__name__}: {e!s}"
return Availability(available=False, note=note)
return Availability(available=False, notes=[note])

async def delete(self, job_id: str) -> None:
"""Delete a job by ID."""
Expand Down

0 comments on commit d8e4559

Please sign in to comment.