aboutsummaryrefslogtreecommitdiffstats
path: root/apps/files/js
diff options
context:
space:
mode:
authorLukas Reschke <lukas@owncloud.com>2015-11-16 22:23:16 +0100
committerLukas Reschke <lukas@owncloud.com>2015-11-28 13:06:53 +0100
commit391bc49dabb39e31739c849b83bb490cabf9da3d (patch)
treee49d514bbbc24d906673123007974b16d5082c98 /apps/files/js
parentd305412a357f31174abff757602b343c24cd91c1 (diff)
downloadnextcloud-server-391bc49dabb39e31739c849b83bb490cabf9da3d.tar.gz
nextcloud-server-391bc49dabb39e31739c849b83bb490cabf9da3d.zip
Move files/ajax/scan.php to background job
The background job will now be executed in chunks of 500 users all 10 minutes.
Diffstat (limited to 'apps/files/js')
-rw-r--r--apps/files/js/files.js48
1 files changed, 0 insertions, 48 deletions
diff --git a/apps/files/js/files.js b/apps/files/js/files.js
index e33b8354437..6bf4a4cfe5a 100644
--- a/apps/files/js/files.js
+++ b/apps/files/js/files.js
@@ -243,9 +243,6 @@
e.preventDefault(); // prevent browser from doing anything, if file isn't dropped in dropZone
});
- //do a background scan if needed
- scanFiles();
-
// display storage warnings
setTimeout(Files.displayStorageWarnings, 100);
@@ -323,51 +320,6 @@
OCA.Files.Files = Files;
})();
-function scanFiles(force, dir, users) {
- if (!OC.currentUser) {
- return;
- }
-
- if (!dir) {
- dir = '';
- }
- force = !!force; //cast to bool
- scanFiles.scanning = true;
- var scannerEventSource;
- if (users) {
- var usersString;
- if (users === 'all') {
- usersString = users;
- } else {
- usersString = JSON.stringify(users);
- }
- scannerEventSource = new OC.EventSource(OC.filePath('files','ajax','scan.php'),{force: force,dir: dir, users: usersString});
- } else {
- scannerEventSource = new OC.EventSource(OC.filePath('files','ajax','scan.php'),{force: force,dir: dir});
- }
- scanFiles.cancel = scannerEventSource.close.bind(scannerEventSource);
- scannerEventSource.listen('count',function(count) {
- console.log(count + ' files scanned');
- });
- scannerEventSource.listen('folder',function(path) {
- console.log('now scanning ' + path);
- });
- scannerEventSource.listen('error',function(message) {
- console.error('Scanner error: ', message);
- });
- scannerEventSource.listen('done',function(count) {
- scanFiles.scanning=false;
- console.log('done after ' + count + ' files');
- if (OCA.Files.App) {
- OCA.Files.App.fileList.updateStorageStatistics(true);
- }
- });
- scannerEventSource.listen('user',function(user) {
- console.log('scanning files for ' + user);
- });
-}
-scanFiles.scanning=false;
-
// TODO: move to FileList
var createDragShadow = function(event) {
// FIXME: inject file list instance somehow