Merge pull request #13855 from tomasz-grobelny/faster_file_upload
Throttle getstoragestats.php calls and allow simultaneous uploads
This commit is contained in:
commit
8fcb9fcfdc
2 changed files with 6 additions and 1 deletions
|
@ -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
|
||||||
|
|
|
@ -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;
|
||||||
})();
|
})();
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue