fixed shutdown isue
All checks were successful
Deploy Plattform-Core / test (push) Successful in 43s
Deploy Plattform-Core / deploy (push) Successful in 5s

This commit is contained in:
ValueOn AG 2026-05-25 16:05:15 +02:00
parent e2d230f2c6
commit 1a1128cc8c
2 changed files with 9 additions and 3 deletions

View file

@ -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
View file

@ -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)