summaryrefslogtreecommitdiffstats
path: root/apps/dav
diff options
context:
space:
mode:
authorArthur Schiwon <blizzz@arthur-schiwon.de>2023-07-10 18:25:24 +0200
committerGitHub <noreply@github.com>2023-07-10 18:25:24 +0200
commit7073c21e2db6292df6270e3fdb64a04dcce72943 (patch)
tree632200813fee4dccbc4a7605778326adee010059 /apps/dav
parent0a876e3ac8138dc8d4734a2491284798c300fdd6 (diff)
parent1196299b613cabb42a5f554dd515c8c41806d29d (diff)
downloadnextcloud-server-7073c21e2db6292df6270e3fdb64a04dcce72943.tar.gz
nextcloud-server-7073c21e2db6292df6270e3fdb64a04dcce72943.zip
Merge pull request #38659 from nextcloud/backport/38649/stable27
[stable27] fix(caldav): Close DB cursor in reminder index background job
Diffstat (limited to 'apps/dav')
-rw-r--r--apps/dav/lib/BackgroundJob/BuildReminderIndexBackgroundJob.php6
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;
}
}