Shutdown
This commit is contained in:
@@ -3,6 +3,7 @@ import logging
|
|||||||
import uvicorn
|
import uvicorn
|
||||||
import signal
|
import signal
|
||||||
import os
|
import os
|
||||||
|
import sys
|
||||||
from starlette.applications import Starlette
|
from starlette.applications import Starlette
|
||||||
from starlette.routing import Route
|
from starlette.routing import Route
|
||||||
from starlette.responses import Response, StreamingResponse, FileResponse
|
from starlette.responses import Response, StreamingResponse, FileResponse
|
||||||
@@ -145,6 +146,5 @@ if __name__ == "__main__":
|
|||||||
except KeyboardInterrupt:
|
except KeyboardInterrupt:
|
||||||
pass
|
pass
|
||||||
finally:
|
finally:
|
||||||
# Final fallback to ensure the process actually dies
|
logger.info("Server process exiting.")
|
||||||
# if the event loop is still hanging on a connection
|
sys.exit(0)
|
||||||
os._exit(0)
|
|
||||||
|
|||||||
Reference in New Issue
Block a user