From b6dac6f2bd96a8e39faaf0916caf906a237c4d44 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=80=9CNaeel=E2=80=9D?= Date: Tue, 14 Jul 2026 10:24:55 +0400 Subject: [PATCH] =?UTF-8?q?fix:=20XHR=20timeout=2030=D1=81=20+=20ontimeout?= =?UTF-8?q?=20=E2=80=94=20=D0=BD=D0=B5=20=D0=B2=D0=B8=D1=81=D0=B5=D1=82?= =?UTF-8?q?=D1=8C=20=D0=B1=D0=B5=D1=81=D0=BA=D0=BE=D0=BD=D0=B5=D1=87=D0=BD?= =?UTF-8?q?=D0=BE=20=D0=BD=D0=B0=20=D0=B7=D0=B0=D0=B3=D1=80=D1=83=D0=B7?= =?UTF-8?q?=D0=BA=D0=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- site/app.py | 2 +- site/templates/index.html | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/site/app.py b/site/app.py index a1cc45a..63bceaa 100644 --- a/site/app.py +++ b/site/app.py @@ -20,7 +20,7 @@ if _sys_path_root not in sys.path: sys.path.insert(0, _sys_path_root) # Версия приложения (меняется при изменениях) -VERSION = "0.0.18" +VERSION = "0.0.19" def create_app(): diff --git a/site/templates/index.html b/site/templates/index.html index c014751..98d6344 100644 --- a/site/templates/index.html +++ b/site/templates/index.html @@ -172,6 +172,7 @@ async function uploadFiles() { await new Promise((resolve, reject) => { const xhr = new XMLHttpRequest(); xhr.open('POST', '/api/upload'); + xhr.timeout = 30000; // 30 сек — не висеть бесконечно xhr.upload.onprogress = function(e) { if (e.lengthComputable) { const pct = Math.round(e.loaded / e.total * 100); @@ -195,6 +196,7 @@ async function uploadFiles() { } }; xhr.onerror = function() { reject(new Error('Сеть')); }; + xhr.ontimeout = function() { reject(new Error('Таймаут 30с')); }; const fd = new FormData(); fd.append('files', f, f.name); if (currentSid) fd.append('session', currentSid);