Initial commit: Arr Summary source from server
This commit is contained in:
commit
c1e30bc8f0
37 changed files with 11661 additions and 0 deletions
22
gunicorn.conf.py
Normal file
22
gunicorn.conf.py
Normal file
|
|
@ -0,0 +1,22 @@
|
|||
# Gunicorn configuration
|
||||
workers = 2 # 2 workers × 4 threads = 8 concurrent requests; fewer cold-cache workers
|
||||
threads = 4
|
||||
worker_class = "gthread"
|
||||
bind = "0.0.0.0:5000"
|
||||
timeout = 30 # fail fast — app has its own 5s internal deadline
|
||||
keepalive = 5
|
||||
|
||||
def post_fork(server, worker):
|
||||
"""Pre-warm the slow caches in each worker right after fork.
|
||||
This runs in the background so the worker is ready instantly."""
|
||||
import threading
|
||||
def _warm():
|
||||
try:
|
||||
import app as a
|
||||
a.get_radarr_summary()
|
||||
a.get_sonarr_summary()
|
||||
a.get_tautulli_summary()
|
||||
except Exception:
|
||||
pass
|
||||
t = threading.Thread(target=_warm, daemon=True)
|
||||
t.start()
|
||||
Loading…
Add table
Add a link
Reference in a new issue