forked from 0x2620/pandora
timeout chunk requests after 5 minutes. try to avoid snap with setTimeout
This commit is contained in:
parent
1d2675ab97
commit
3d3787b802
1 changed files with 4 additions and 1 deletions
|
@ -174,6 +174,7 @@ pandora.fs = (function() {
|
|||
xhr.setRequestHeader('Range', 'bytes=' + offset + '-' + end);
|
||||
xhr.withCredentials = true;
|
||||
xhr.responseType = 'blob';
|
||||
xhr.timeout = 1000 * 60 * 5;
|
||||
xhr.addEventListener('progress', function(event) {
|
||||
if (event.lengthComputable) {
|
||||
if (!total) {
|
||||
|
@ -196,7 +197,9 @@ pandora.fs = (function() {
|
|||
if (offset + blobSize < total) {
|
||||
partialDownload(offset + blobSize + 1);
|
||||
} else {
|
||||
that.storeBlob(new Blob(blobs), name, callback);
|
||||
setTimeout() {
|
||||
that.storeBlob(new Blob(blobs), name, callback);
|
||||
});
|
||||
}
|
||||
});
|
||||
xhr.addEventListener('error', function (event) {
|
||||
|
|
Loading…
Reference in a new issue