feat(chalice): graceful shutdown
This commit is contained in:
parent
1935988433
commit
bb1d0cf1b6
1 changed files with 2 additions and 1 deletions
|
|
@ -81,7 +81,8 @@ async def shutdown():
|
|||
await pg_client.terminate()
|
||||
|
||||
|
||||
@app.get('/private/suicide', tags=["private"])
|
||||
@app.get('/private/shutdown', tags=["private"])
|
||||
async def stop_server():
|
||||
await shutdown()
|
||||
import os, signal
|
||||
os.kill(1, signal.SIGTERM)
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue