fixed shutdown isue
This commit is contained in:
parent
e2d230f2c6
commit
1a1128cc8c
2 changed files with 9 additions and 3 deletions
|
|
@ -46,5 +46,4 @@ HEALTHCHECK --interval=30s --timeout=10s --start-period=40s --retries=3 \
|
||||||
CMD python -c "import requests; requests.get('http://localhost:8000/api/admin/health', timeout=5)" || exit 1
|
CMD python -c "import requests; requests.get('http://localhost:8000/api/admin/health', timeout=5)" || exit 1
|
||||||
|
|
||||||
# Run the application
|
# Run the application
|
||||||
# Cloud Run will set PORT env var, uvicorn reads it automatically
|
CMD exec uvicorn app:app --host 0.0.0.0 --port ${PORT:-8000} --workers 1 --timeout-graceful-shutdown 5
|
||||||
CMD exec uvicorn app:app --host 0.0.0.0 --port ${PORT:-8000} --workers 1
|
|
||||||
|
|
|
||||||
9
app.py
9
app.py
|
|
@ -723,4 +723,11 @@ app.include_router(automationWorkspaceRouter)
|
||||||
from modules.system.registry import loadFeatureRouters
|
from modules.system.registry import loadFeatureRouters
|
||||||
|
|
||||||
featureLoadResults = loadFeatureRouters(app)
|
featureLoadResults = loadFeatureRouters(app)
|
||||||
logger.info(f"Feature router load results: {featureLoadResults}")
|
logger.info(f"Feature router load results: {featureLoadResults}")
|
||||||
|
|
||||||
|
|
||||||
|
if __name__ == "__main__":
|
||||||
|
import uvicorn
|
||||||
|
|
||||||
|
port = int(os.environ.get("PORT", 8000))
|
||||||
|
uvicorn.run("app:app", host="0.0.0.0", port=port, workers=1, timeout_graceful_shutdown=5)
|
||||||
Loading…
Reference in a new issue