Browse Source

Throttle getstoragestats.php calls and allow simultaneous uploads

Signed-off-by: Tomasz Grobelny <tomasz@grobelny.net>
tags/v16.0.0alpha1
Tomasz Grobelny 5 years ago
parent
commit
f99ce0d546
2 changed files with 6 additions and 1 deletions
  1. 2
    1
      apps/files/js/file-upload.js
  2. 4
    0
      apps/files/js/files.js

+ 2
- 1
apps/files/js/file-upload.js View File

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

+ 4
- 0
apps/files/js/files.js View File

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

Files._updateStorageStatisticsDebounced = _.debounce(Files._updateStorageStatistics, 250);
Files._updateStorageQuotasThrottled = _.throttle(Files._updateStorageQuotas, 30000);
OCA.Files.Files = Files;
})();


Loading…
Cancel
Save