Skip to content

Commit

Permalink
Fix(StorageCrawlJob): Increase batch size to 2000
Browse files Browse the repository at this point in the history
Signed-off-by: Marcel Klehr <[email protected]>
  • Loading branch information
marcelklehr committed Sep 17, 2023
1 parent 59ed22b commit d3acd33
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lib/BackgroundJobs/StorageCrawlJob.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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);
Expand Down

0 comments on commit d3acd33

Please sign in to comment.