v0.0.43: таймаут загрузки 30с → 300с (загрузка больших файлов нестабильна через шлюз)
This commit is contained in:
+1
-1
@@ -20,7 +20,7 @@ if _sys_path_root not in sys.path:
|
|||||||
sys.path.insert(0, _sys_path_root)
|
sys.path.insert(0, _sys_path_root)
|
||||||
|
|
||||||
# Версия приложения (меняется при изменениях)
|
# Версия приложения (меняется при изменениях)
|
||||||
VERSION = "0.0.42"
|
VERSION = "0.0.43"
|
||||||
|
|
||||||
|
|
||||||
def create_app():
|
def create_app():
|
||||||
|
|||||||
@@ -393,7 +393,7 @@ async function uploadFiles() {
|
|||||||
const url = '/api/upload?_=' + Date.now();
|
const url = '/api/upload?_=' + Date.now();
|
||||||
const xhr = new XMLHttpRequest();
|
const xhr = new XMLHttpRequest();
|
||||||
xhr.open('POST', url);
|
xhr.open('POST', url);
|
||||||
xhr.timeout = 30000;
|
xhr.timeout = 300000; // 300с: загрузка больших файлов нестабильна через шлюз
|
||||||
xhr.upload.onprogress = function(e) {
|
xhr.upload.onprogress = function(e) {
|
||||||
if (e.lengthComputable) {
|
if (e.lengthComputable) {
|
||||||
const pct = Math.round(e.loaded / e.total * 100);
|
const pct = Math.round(e.loaded / e.total * 100);
|
||||||
@@ -417,7 +417,7 @@ async function uploadFiles() {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
xhr.onerror = function() { reject(new Error('Сеть')); };
|
xhr.onerror = function() { reject(new Error('Сеть')); };
|
||||||
xhr.ontimeout = function() { reject(new Error('Таймаут 30с')); };
|
xhr.ontimeout = function() { reject(new Error('Таймаут 300с')); };
|
||||||
activeXHR = xhr;
|
activeXHR = xhr;
|
||||||
xhr.send(fd);
|
xhr.send(fd);
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user