From d3acd336289a06906bb313ee101132f131d49e5f Mon Sep 17 00:00:00 2001 From: Marcel Klehr Date: Sun, 17 Sep 2023 11:43:31 +0200 Subject: [PATCH] Fix(StorageCrawlJob): Increase batch size to 2000 Signed-off-by: Marcel Klehr --- lib/BackgroundJobs/StorageCrawlJob.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/BackgroundJobs/StorageCrawlJob.php b/lib/BackgroundJobs/StorageCrawlJob.php index 3da81826..ca7f7301 100644 --- a/lib/BackgroundJobs/StorageCrawlJob.php +++ b/lib/BackgroundJobs/StorageCrawlJob.php @@ -23,6 +23,7 @@ use Psr\Log\LoggerInterface; class StorageCrawlJob extends QueuedJob { + public const BATCH_SIZE = 2000; private LoggerInterface $logger; private QueueService $queue; private IJobList $jobList; @@ -62,7 +63,7 @@ protected function run($argument): void { $this->jobList->remove(self::class, $argument); $i = 0; - foreach ($this->storageService->getFilesInMount($storageId, $overrideRoot, $models, $lastFileId) as $file) { + foreach ($this->storageService->getFilesInMount($storageId, $overrideRoot, $models, $lastFileId, self::BATCH_SIZE) as $file) { $i++; $queueFile = new QueueFile(); $queueFile->setStorageId($storageId);