Skip to content

Commit

Permalink
transit_session_status() returns SessionStatus
Browse files Browse the repository at this point in the history
  • Loading branch information
fregataa committed Jun 18, 2024
1 parent 3753e07 commit 5be5355
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/ai/backend/manager/registry.py
Original file line number Diff line number Diff line change
Expand Up @@ -3226,7 +3226,7 @@ async def transit_session_status(
db_conn: SAConnection,
session_id: SessionId,
status_changed_at: datetime | None = None,
) -> None:
) -> SessionStatus:
now = status_changed_at or datetime.now(tzutc())

async def _get_and_transit(
Expand All @@ -3241,7 +3241,7 @@ async def _get_and_transit(
)

if not transited:
return
return session_row.status
match session_row.status:
case SessionStatus.RUNNING:
log.debug(
Expand Down Expand Up @@ -3269,6 +3269,7 @@ async def _get_and_transit(
)
case _:
pass
return session_row.status

async def set_status_updatable_session(self, session_id: SessionId) -> None:
await redis_helper.execute(
Expand Down

0 comments on commit 5be5355

Please sign in to comment.