From 560b61c4314872ac1ed4d244db376c3543cc9d0f Mon Sep 17 00:00:00 2001 From: shokollm <270575765+shokollm@users.noreply.github.com> Date: Fri, 10 Apr 2026 08:51:03 +0000 Subject: [PATCH] fix: increase timeout for long-running AI chat requests --- deployment/scripts/nginx-template.conf | 3 +++ deployment/scripts/systemd-template.service | 2 ++ src/backend/run.py | 1 + 3 files changed, 6 insertions(+) diff --git a/deployment/scripts/nginx-template.conf b/deployment/scripts/nginx-template.conf index 9658b5e..92e9142 100644 --- a/deployment/scripts/nginx-template.conf +++ b/deployment/scripts/nginx-template.conf @@ -34,6 +34,9 @@ server { proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header X-Forwarded-Proto $scheme; proxy_cache_bypass $http_upgrade; + proxy_read_timeout 300s; + proxy_connect_timeout 75s; + proxy_send_timeout 300s; } location /ws/ { diff --git a/deployment/scripts/systemd-template.service b/deployment/scripts/systemd-template.service index 9eaa786..0629ae5 100644 --- a/deployment/scripts/systemd-template.service +++ b/deployment/scripts/systemd-template.service @@ -10,6 +10,8 @@ Environment="PATH=/var/www/bot/src/backend/venv/bin" ExecStart=/var/www/bot/src/backend/venv/bin/python /var/www/bot/src/backend/run.py Restart=always RestartSec=10 +TimeoutStartSec=300 +TimeoutStopSec=300 EnvironmentFile=/var/www/bot/data/.env diff --git a/src/backend/run.py b/src/backend/run.py index f6e2e80..446c9f9 100644 --- a/src/backend/run.py +++ b/src/backend/run.py @@ -8,4 +8,5 @@ if __name__ == "__main__": host=settings.HOST, port=settings.PORT, reload=settings.DEBUG, + timeout_keep_alive=300, )