Skip to content

Commit

Permalink
fix: Update the codes added in #2275
Browse files Browse the repository at this point in the history
  • Loading branch information
achimnol committed Jul 23, 2024
1 parent 3bb3d31 commit 5eeb502
Showing 1 changed file with 10 additions and 7 deletions.
17 changes: 10 additions & 7 deletions src/ai/backend/manager/registry.py
Original file line number Diff line number Diff line change
Expand Up @@ -2225,21 +2225,21 @@ async def _destroy(db_session: AsyncSession) -> SessionRow:
kern.status = kernel_target_status
kern.terminated_at = current_time
kern.status_info = destroy_reason
kern.status_history = sql_json_merge(
kern.status_history = sql_append_dict_to_list(
KernelRow.status_history,
(),
{
kernel_target_status.name: current_time.isoformat(),
"status": kernel_target_status.name,
"timestamp": now.isoformat(),
},
)
session_row.status = target_status
session_row.terminated_at = current_time
session_row.status_info = destroy_reason
session_row.status_history = sql_json_merge(
session_row.status_history = sql_append_dict_to_list(
SessionRow.status_history,
(),
{
target_status.name: current_time.isoformat(),
"status": target_status.name,
"timestamp": current_time.isoformat(),
},
)
return session_row
Expand Down Expand Up @@ -3239,7 +3239,10 @@ async def _update_kernel() -> tuple[AccessKey, AgentId] | None:
),
"status_history": sql_append_dict_to_list(
KernelRow.status_history,
{"status": KernelStatus.TERMINATED.name, "timestamp": now.isoformat()},
{
"status": KernelStatus.TERMINATED.name,
"timestamp": now.isoformat(),
},
),
"terminated_at": now,
}
Expand Down

0 comments on commit 5eeb502

Please sign in to comment.