fmab777 commited on
Commit
0d6c1ce
·
verified ·
1 Parent(s): d7e7b10

Update gunicorn.conf.py

Browse files
Files changed (1) hide show
  1. gunicorn.conf.py +7 -15
gunicorn.conf.py CHANGED
@@ -1,21 +1,13 @@
1
- # gunicorn.conf.py (Should be fine as is)
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
- bind = f"0.0.0.0:{os.environ.get('PORT', '7860')}" # PORT is standard on HF
12
-
13
- # Optional: Increase timeout if startup/requests are slow
14
- # timeout = 120
15
-
16
- # Log levels can also be set here, but rely on code/Uvicorn settings first
17
- # loglevel = 'info'
18
 
19
- # Point Gunicorn to the ASGI app instance (ensure filename matches)
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