mirror of
https://github.com/nextcloud/server.git
synced 2026-05-15 01:49:53 -04:00
fix(files_metadata): Don't run generation job on every upgrade
Signed-off-by: Louis Chemineau <louis@chmn.me>
This commit is contained in:
parent
4689f3d2ab
commit
71247f22ef
1 changed files with 7 additions and 2 deletions
|
|
@ -53,9 +53,14 @@ class GenerateMetadataJob extends TimedJob {
|
|||
}
|
||||
|
||||
protected function run(mixed $argument): void {
|
||||
$users = $this->userManager->search('');
|
||||
if ($this->config->getAppValue('core', 'metadataGenerationDone', 'false') !== 'false') {
|
||||
return;
|
||||
}
|
||||
|
||||
$lastHandledUser = $this->config->getAppValue('core', 'metadataGenerationLastHandledUser', '');
|
||||
|
||||
$users = $this->userManager->search('');
|
||||
|
||||
// we'll only start timer once we have found a valid user to handle
|
||||
// meaning NOW if we have not handled any user from a previous run
|
||||
$startTime = ($lastHandledUser === '') ? time() : null;
|
||||
|
|
@ -79,8 +84,8 @@ class GenerateMetadataJob extends TimedJob {
|
|||
}
|
||||
}
|
||||
|
||||
$this->jobList->remove(GenerateMetadataJob::class);
|
||||
$this->config->deleteAppValue('core', 'metadataGenerationLastHandledUser');
|
||||
$this->config->setAppValue('core', 'metadataGenerationDone', 'true');
|
||||
}
|
||||
|
||||
private function scanFilesForUser(string $userId): void {
|
||||
|
|
|
|||
Loading…
Reference in a new issue