From c40c681d2e96c07f5f0c32d3412b9812b8700a96 Mon Sep 17 00:00:00 2001 From: gilesb Date: Fri, 9 Jan 2026 03:34:13 +0000 Subject: [PATCH] Add uvicorn workers and Redis timeouts - Run uvicorn with 4 workers to handle concurrent requests - Add socket_timeout and socket_connect_timeout to Redis client (5s) Co-Authored-By: Claude Opus 4.5 --- server.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/server.py b/server.py index 9ea7e5c..dee1dfc 100644 --- a/server.py +++ b/server.py @@ -66,7 +66,9 @@ parsed = urlparse(REDIS_URL) redis_client = redis.Redis( host=parsed.hostname or 'localhost', port=parsed.port or 6379, - db=int(parsed.path.lstrip('/') or 0) + db=int(parsed.path.lstrip('/') or 0), + socket_timeout=5, + socket_connect_timeout=5 ) RUNS_KEY_PREFIX = "artdag:run:" RECIPES_KEY_PREFIX = "artdag:recipe:" @@ -3986,4 +3988,4 @@ async def ui_run_partial(run_id: str, request: Request): if __name__ == "__main__": import uvicorn - uvicorn.run(app, host="0.0.0.0", port=8100) + uvicorn.run(app, host="0.0.0.0", port=8100, workers=4)