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);