Spaces:
Running
Running
Update gunicorn.conf.py
Browse files- gunicorn.conf.py +7 -15
gunicorn.conf.py
CHANGED
@@ -1,21 +1,13 @@
|
|
1 |
-
# gunicorn.conf.py
|
2 |
import os
|
3 |
|
4 |
-
# UvicornWorker is correct for ASGI (Starlette)
|
5 |
worker_class = 'uvicorn.workers.UvicornWorker'
|
6 |
-
|
7 |
-
# Can potentially increase workers if the lifespan init is robust
|
8 |
-
# Start with 1 on free tiers to conserve memory, test with more if needed
|
9 |
workers = int(os.environ.get('GUNICORN_WORKERS', '1'))
|
|
|
10 |
|
11 |
-
|
12 |
-
|
13 |
-
#
|
14 |
-
|
15 |
-
|
16 |
-
# Log levels can also be set here, but rely on code/Uvicorn settings first
|
17 |
-
# loglevel = 'info'
|
18 |
|
19 |
-
#
|
20 |
-
# This is usually done in the command line: gunicorn main:app -c gunicorn.conf.py
|
21 |
-
# No need to set 'app' variable here.
|
|
|
1 |
+
# gunicorn.conf.py
|
2 |
import os
|
3 |
|
|
|
4 |
worker_class = 'uvicorn.workers.UvicornWorker'
|
|
|
|
|
|
|
5 |
workers = int(os.environ.get('GUNICORN_WORKERS', '1'))
|
6 |
+
bind = f"0.0.0.0:{os.environ.get('PORT', '7860')}"
|
7 |
|
8 |
+
# *** FIX: Add explicit timeout longer than API timeouts ***
|
9 |
+
# Set to slightly longer than the longest expected API call (e.g., OpenRouter's 180s)
|
10 |
+
# Use 200 seconds here. Adjust if needed.
|
11 |
+
timeout = 200
|
|
|
|
|
|
|
12 |
|
13 |
+
# loglevel = 'info' # Optional log level override
|
|
|
|