Skip to content

Commit

Permalink
Merge pull request #8931 from nextcloud/fix/chunk-preprocessing-messages
Browse files Browse the repository at this point in the history
fix(preprocessing): chunk message query
  • Loading branch information
miaulalala authored Oct 9, 2023
2 parents a3f46be + 62a1c98 commit 1ec5caa
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions lib/Service/PreprocessingService.php
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,10 @@ public function process(int $limitTimestamp, Account $account): void {
return $mailbox->getId();
}, $mailboxes));


$messages = $this->messageMapper->getUnanalyzed($limitTimestamp, $mailboxIds);
$messages = [];
foreach(array_chunk($mailboxIds, 1000) as $chunk) {
$messages = array_merge($messages, $this->messageMapper->getUnanalyzed($limitTimestamp, $chunk));
}
if ($messages === []) {
$this->logger->debug('No structure data to analyse.');
return;
Expand Down

0 comments on commit 1ec5caa

Please sign in to comment.