From 391d733c1b03fd8bc409fb41740f4168931163d6 Mon Sep 17 00:00:00 2001 From: marwin Date: Thu, 19 Mar 2026 19:15:01 +0100 Subject: [PATCH] Use gevent workers in gunicorn to fix SSE blocking SSE connections for radio streams were blocking sync gunicorn workers, leaving the app unresponsive. Switching to gevent with 4 workers and a higher timeout fixes concurrent SSE + normal request handling. Co-Authored-By: Claude Sonnet 4.6 --- Dockerfile | 2 +- requirements.txt | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 22e29f0..1664430 100644 --- a/Dockerfile +++ b/Dockerfile @@ -15,4 +15,4 @@ RUN python manage.py collectstatic --noinput && mkdir -p /app/data EXPOSE 8000 -CMD ["sh", "-c", "python manage.py migrate --noinput && gunicorn diora.wsgi:application --bind 0.0.0.0:8000 --workers 2"] +CMD ["sh", "-c", "python manage.py migrate --noinput && gunicorn diora.wsgi:application --bind 0.0.0.0:8000 --workers 4 --worker-class gevent --timeout 120"] diff --git a/requirements.txt b/requirements.txt index 2f2f6eb..38524e9 100644 --- a/requirements.txt +++ b/requirements.txt @@ -4,3 +4,4 @@ requests>=2.31 python-dotenv>=1.0 whitenoise>=6.6 feedparser>=6.0 +gevent>=24.0