Skip to content

Commit

Permalink
runtime server stop with drain calls
Browse files Browse the repository at this point in the history
  • Loading branch information
boetro committed Nov 27, 2023
1 parent d951778 commit 96c7ce1
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions buildflow/core/app/runtime/server.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
import uvicorn
from fastapi import APIRouter, FastAPI
from fastapi.responses import HTMLResponse, JSONResponse
from ray import kill

from buildflow.core.app.flow_state import FlowState
from buildflow.core.app.infra.actors.infra import InfraActor
Expand Down Expand Up @@ -115,7 +114,9 @@ async def runtime_snapshot(self):
return JSONResponse(snapshot.as_dict())

async def runtime_stop(self):
kill(self.runtime_actor)
# Send two drain requests to stop the runtime.
self.runtime_actor.drain.remote()
self.runtime_actor.drain.remote()

async def runtime_status(self):
status = await self.runtime_actor.status.remote()
Expand Down

0 comments on commit 96c7ce1

Please sign in to comment.