Skip to content

Commit

Permalink
fix: use responses.JSONResponse for dict serialize
Browse files Browse the repository at this point in the history
  • Loading branch information
andylizf committed Oct 10, 2024
1 parent d667a99 commit 9e552c7
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions sky/serve/controller.py
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ async def terminate_replica(
replica_status = replica_info.status

if replica_status == serve_state.ReplicaStatus.SHUTTING_DOWN:
return fastapi.Response(
return responses.JSONResponse(
status_code=409,
content={
'message': f'Already scheduled to terminate '
Expand All @@ -184,7 +184,7 @@ async def terminate_replica(

if (replica_status in serve_state.ReplicaStatus.failed_statuses()
and not purge):
return fastapi.Response(
return responses.JSONResponse(
status_code=409,
content={
'message': f'{colorama.Fore.YELLOW}Replica '
Expand All @@ -204,7 +204,7 @@ async def terminate_replica(

message = (f'Replica {replica_id} of service '
f'{self._service_name!r} is scheduled to be ')
return fastapi.Response(
return responses.JSONResponse(
status_code=200,
content={
'message': message +
Expand Down

0 comments on commit 9e552c7

Please sign in to comment.