Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/server.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobin Appelman <robin@icewind.nl>2021-11-17 17:04:51 +0300
committerMichaIng <micha@dietpi.com>2021-12-06 03:11:44 +0300
commitaa6ed02587df06d6fc9ff3534a8f0622d7bde47e (patch)
tree522fed419592dd8409bf9e7afee32bc3586fbdb2 /apps/files
parenta33a0a614ffbf8ecd670150ee2138ba8a762f4d3 (diff)
stop background scan early if a users still has unscanned files after background scan
Signed-off-by: Robin Appelman <robin@icewind.nl>
Diffstat (limited to 'apps/files')
-rw-r--r--apps/files/lib/BackgroundJob/ScanFiles.php8
1 files changed, 7 insertions, 1 deletions
diff --git a/apps/files/lib/BackgroundJob/ScanFiles.php b/apps/files/lib/BackgroundJob/ScanFiles.php
index 37416aed521..250338e1262 100644
--- a/apps/files/lib/BackgroundJob/ScanFiles.php
+++ b/apps/files/lib/BackgroundJob/ScanFiles.php
@@ -116,11 +116,17 @@ class ScanFiles extends \OC\BackgroundJob\TimedJob {
}
$usersScanned = 0;
+ $lastUser = '';
$user = $this->getUserToScan();
- while ($user && $usersScanned < self::USERS_PER_SESSION) {
+ while ($user && $usersScanned < self::USERS_PER_SESSION && $lastUser !== $user) {
$this->runScanner($user);
+ $lastUser = $user;
$user = $this->getUserToScan();
$usersScanned += 1;
}
+
+ if ($lastUser === $user) {
+ $this->logger->warning("User $user still has unscanned files after running background scan, background scan might be stopped prematurely");
+ }
}
}