Merge pull request #13855 from tomasz-grobelny/faster_file_upload

Throttle getstoragestats.php calls and allow simultaneous uploads
This commit is contained in:
Christoph Wurst 2019-01-29 08:51:38 +01:00 committed by GitHub
commit 8fcb9fcfdc
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 1 deletions

View file

@ -845,7 +845,8 @@ OC.Uploader.prototype = _.extend({
type: 'PUT', type: 'PUT',
dropZone: options.dropZone, // restrict dropZone to content div dropZone: options.dropZone, // restrict dropZone to content div
autoUpload: false, autoUpload: false,
sequentialUploads: true, sequentialUploads: false,
limitConcurrentUploads: 10,
//singleFileUploads is on by default, so the data.files array will always have length 1 //singleFileUploads is on by default, so the data.files array will always have length 1
/** /**
* on first add of every selection * on first add of every selection

View file

@ -33,6 +33,9 @@
}, },
// update quota // update quota
updateStorageQuotas: function() { updateStorageQuotas: function() {
Files._updateStorageQuotasThrottled();
},
_updateStorageQuotas: function() {
var state = Files.updateStorageQuotas; var state = Files.updateStorageQuotas;
state.call = $.getJSON(OC.filePath('files','ajax','getstoragestats.php'),function(response) { state.call = $.getJSON(OC.filePath('files','ajax','getstoragestats.php'),function(response) {
Files.updateQuota(response); Files.updateQuota(response);
@ -356,6 +359,7 @@
}; };
Files._updateStorageStatisticsDebounced = _.debounce(Files._updateStorageStatistics, 250); Files._updateStorageStatisticsDebounced = _.debounce(Files._updateStorageStatistics, 250);
Files._updateStorageQuotasThrottled = _.throttle(Files._updateStorageQuotas, 30000);
OCA.Files.Files = Files; OCA.Files.Files = Files;
})(); })();