diff options
author | Christoph Wurst <christoph@winzerhof-wurst.at> | 2023-06-05 18:47:24 +0200 |
---|---|---|
committer | backportbot-nextcloud[bot] <backportbot-nextcloud[bot]@users.noreply.github.com> | 2023-06-06 07:22:40 +0000 |
commit | 1196299b613cabb42a5f554dd515c8c41806d29d (patch) | |
tree | 0b94cdf16e8e9a55a043ee57bebd9082787ce453 /apps/dav | |
parent | 2eaf70b92cffd0a10e98be14151195f577526861 (diff) | |
download | nextcloud-server-1196299b613cabb42a5f554dd515c8c41806d29d.tar.gz nextcloud-server-1196299b613cabb42a5f554dd515c8c41806d29d.zip |
fix(caldav): Close DB cursor in reminder index background job
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
Diffstat (limited to 'apps/dav')
-rw-r--r-- | apps/dav/lib/BackgroundJob/BuildReminderIndexBackgroundJob.php | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/apps/dav/lib/BackgroundJob/BuildReminderIndexBackgroundJob.php b/apps/dav/lib/BackgroundJob/BuildReminderIndexBackgroundJob.php index 2ae47ee89ea..a38524da9e2 100644 --- a/apps/dav/lib/BackgroundJob/BuildReminderIndexBackgroundJob.php +++ b/apps/dav/lib/BackgroundJob/BuildReminderIndexBackgroundJob.php @@ -105,8 +105,8 @@ class BuildReminderIndexBackgroundJob extends QueuedJob { ->andWhere($query->expr()->gt('id', $query->createNamedParameter($offset))) ->orderBy('id', 'ASC'); - $stmt = $query->execute(); - while ($row = $stmt->fetch(\PDO::FETCH_ASSOC)) { + $result = $query->executeQuery(); + while ($row = $result->fetch(\PDO::FETCH_ASSOC)) { $offset = $row['id']; if (is_resource($row['calendardata'])) { $row['calendardata'] = stream_get_contents($row['calendardata']); @@ -120,10 +120,12 @@ class BuildReminderIndexBackgroundJob extends QueuedJob { } if (($this->timeFactory->getTime() - $startTime) > 15) { + $result->closeCursor(); return $offset; } } + $result->closeCursor(); return $stopAt; } } |