mirror of
https://github.com/nextcloud/server.git
synced 2026-02-20 00:12:30 -05:00
stop background scan early if a users still has unscanned files after background scan
Signed-off-by: Robin Appelman <robin@icewind.nl>
This commit is contained in:
parent
38921ab498
commit
89bc9f1b77
1 changed files with 7 additions and 1 deletions
|
|
@ -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");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue