From 70a01db4228648a21c458e7fc197425fd7268bc1 Mon Sep 17 00:00:00 2001 From: Christian Date: Thu, 11 Jun 2026 12:53:52 +0200 Subject: [PATCH] Default API workers to 1 to keep telefoni websocket events reliable --- main.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/main.py b/main.py index b45fdc6..95f71e9 100644 --- a/main.py +++ b/main.py @@ -536,12 +536,18 @@ if __name__ == "__main__": log_level="info" ) else: + api_workers_raw = os.getenv("API_WORKERS", "1").strip() + try: + api_workers = max(1, int(api_workers_raw)) + except ValueError: + api_workers = 1 + uvicorn.run( "main:app", host="0.0.0.0", port=8000, reload=False, - workers=2, + workers=api_workers, timeout_keep_alive=65, access_log=True, log_level="info"