diff options
author | Christoph Wurst <christoph@winzerhof-wurst.at> | 2022-10-24 18:46:13 +0300 |
---|---|---|
committer | Christoph Wurst <christoph@winzerhof-wurst.at> | 2022-10-24 18:46:13 +0300 |
commit | 57d0bdd7baae62d4c320fccdb09e81fe517ef7b2 (patch) | |
tree | 9088fa2c6d94e6d1cac3479c0bc12eea53260a77 /lib | |
parent | 937030e22deb2868eb13be592c539e1c3c01231c (diff) |
Fix OOM during cache clean-up
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
Diffstat (limited to 'lib')
-rw-r--r-- | lib/Db/MessageMapper.php | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/lib/Db/MessageMapper.php b/lib/Db/MessageMapper.php index 63d0e1e13..011c7d7b5 100644 --- a/lib/Db/MessageMapper.php +++ b/lib/Db/MessageMapper.php @@ -1225,9 +1225,10 @@ class MessageMapper extends QBMapper { ->leftJoin('m', 'mail_mailboxes', 'mb', $qb1->expr()->eq('m.mailbox_id', 'mb.id')) ->where($qb1->expr()->isNull('mb.id')); $result = $idsQuery->execute(); - $ids = array_map(function (array $row) { - return (int)$row['id']; - }, $result->fetchAll()); + $ids = []; + while ($row = $result->fetch()) { + $ids[] = (int) $row['id']; + } $result->closeCursor(); $qb2 = $this->db->getQueryBuilder(); @@ -1247,9 +1248,9 @@ class MessageMapper extends QBMapper { $qb3->expr()->isNull('r.local_message_id') ); $result = $recipientIdsQuery->execute(); - $ids = array_map(function (array $row) { - return (int)$row['id']; - }, $result->fetchAll()); + while ($row = $result->fetch()) { + $ids[] = (int) $row['id']; + } $result->closeCursor(); $qb4 = $this->db->getQueryBuilder(); |