v2.0.3: таймауты 30s/60s + console.log отладка
This commit is contained in:
@@ -60,7 +60,7 @@
|
|||||||
<body>
|
<body>
|
||||||
<div class="topbar">
|
<div class="topbar">
|
||||||
<img src="{{ url_for('static', filename='nubes-logo.svg') }}" alt="Nubes">
|
<img src="{{ url_for('static', filename='nubes-logo.svg') }}" alt="Nubes">
|
||||||
<span class="title">Сверка договоров <span style="font-weight:400;color:var(--muted);font-size:12px;">v2.0.2</span></span>
|
<span class="title">Сверка договоров <span style="font-weight:400;color:var(--muted);font-size:12px;">v2.0.3</span></span>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="content">
|
<div class="content">
|
||||||
@@ -177,12 +177,14 @@
|
|||||||
var uploadId = 'u' + Date.now().toString(36) + Math.random().toString(36).substr(2, 7);
|
var uploadId = 'u' + Date.now().toString(36) + Math.random().toString(36).substr(2, 7);
|
||||||
var done = 0;
|
var done = 0;
|
||||||
|
|
||||||
|
console.log('uploadFileChunked: ' + file.name + ' b64=' + b64.length + ' chunks=' + totalChunks + ' uploadId=' + uploadId);
|
||||||
function sendChunk(i) {
|
function sendChunk(i) {
|
||||||
if (i >= totalChunks) {
|
if (i >= totalChunks) {
|
||||||
|
console.log('finalize: ' + uploadId);
|
||||||
var xhr = new XMLHttpRequest();
|
var xhr = new XMLHttpRequest();
|
||||||
xhr.open('POST', '/v2/finalize');
|
xhr.open('POST', '/v2/finalize');
|
||||||
xhr.setRequestHeader('Content-Type', 'application/json');
|
xhr.setRequestHeader('Content-Type', 'application/json');
|
||||||
xhr.timeout = 15000;
|
xhr.timeout = 60000;
|
||||||
xhr.onload = function() {
|
xhr.onload = function() {
|
||||||
try {
|
try {
|
||||||
var r = JSON.parse(xhr.responseText);
|
var r = JSON.parse(xhr.responseText);
|
||||||
@@ -196,10 +198,11 @@
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
var piece = b64.substring(i * CHUNK, (i + 1) * CHUNK);
|
var piece = b64.substring(i * CHUNK, (i + 1) * CHUNK);
|
||||||
|
console.log('chunk ' + i + '/' + totalChunks + ' send ' + piece.length + ' bytes');
|
||||||
var xhr = new XMLHttpRequest();
|
var xhr = new XMLHttpRequest();
|
||||||
xhr.open('POST', '/v2/chunk');
|
xhr.open('POST', '/v2/chunk');
|
||||||
xhr.setRequestHeader('Content-Type', 'application/json');
|
xhr.setRequestHeader('Content-Type', 'application/json');
|
||||||
xhr.timeout = 10000;
|
xhr.timeout = 30000;
|
||||||
xhr.onload = function() {
|
xhr.onload = function() {
|
||||||
if (xhr.status === 200) {
|
if (xhr.status === 200) {
|
||||||
try {
|
try {
|
||||||
|
|||||||
Reference in New Issue
Block a user