Skip to content

Commit

Permalink
fix(preprocessing): chunk message query
Browse files Browse the repository at this point in the history
Signed-off-by: Anna Larch <[email protected]>
  • Loading branch information
miaulalala committed Oct 5, 2023
1 parent 89d5ccc commit 62a1c98
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 62a1c98

Please sign in to comment.