aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChristoph Wurst <ChristophWurst@users.noreply.github.com>2019-01-29 08:51:38 +0100
committerGitHub <noreply@github.com>2019-01-29 08:51:38 +0100
commit8fcb9fcfdc0f4322154d31bba46b89464dcd32a5 (patch)
treedd67ecd7f1f92832cfdad5e3f2a402b462cb4835
parent198a45ff75c64d38c1ccb6bd903ee55b446177b3 (diff)
parentf99ce0d546c8332bb46807eed21fcdf7d5d0ab71 (diff)
downloadnextcloud-server-8fcb9fcfdc0f4322154d31bba46b89464dcd32a5.tar.gz
nextcloud-server-8fcb9fcfdc0f4322154d31bba46b89464dcd32a5.zip
Merge pull request #13855 from tomasz-grobelny/faster_file_upload
Throttle getstoragestats.php calls and allow simultaneous uploads
-rw-r--r--apps/files/js/file-upload.js3
-rw-r--r--apps/files/js/files.js4
2 files changed, 6 insertions, 1 deletions
diff --git a/apps/files/js/file-upload.js b/apps/files/js/file-upload.js
index bc1a4b36794..9f1912d590d 100644
--- a/apps/files/js/file-upload.js
+++ b/apps/files/js/file-upload.js
@@ -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
diff --git a/apps/files/js/files.js b/apps/files/js/files.js
index 016aef05a96..a785a44ddd6 100644
--- a/apps/files/js/files.js
+++ b/apps/files/js/files.js
@@ -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;
})();