From 62a1c98a83677b937dff8f890acd9db74e5c349a Mon Sep 17 00:00:00 2001 From: Anna Larch Date: Thu, 5 Oct 2023 17:00:19 +0200 Subject: [PATCH] fix(preprocessing): chunk message query Signed-off-by: Anna Larch --- lib/Service/PreprocessingService.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/lib/Service/PreprocessingService.php b/lib/Service/PreprocessingService.php index 8301f7c3a9..dc66f2633b 100644 --- a/lib/Service/PreprocessingService.php +++ b/lib/Service/PreprocessingService.php @@ -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;