diff options
author | Richard Steinmetz <richard@steinmetz.cloud> | 2023-06-06 08:57:59 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-06-06 08:57:59 +0200 |
commit | fec2cc69f4d9003770373a406805e88b5eaefba9 (patch) | |
tree | 9652eae2d63349d97cb18f9d2fa4ce06f80c1981 | |
parent | 3846ec2899d476c03765859487bce4a8ccd0e799 (diff) | |
parent | 6f3f84e955253ebb3316ee266bb5b1d5af3f130d (diff) | |
download | nextcloud-server-fec2cc69f4d9003770373a406805e88b5eaefba9.tar.gz nextcloud-server-fec2cc69f4d9003770373a406805e88b5eaefba9.zip |
Merge pull request #38649 from nextcloud/fix/caldav/close-reminder-index-job-cursor
fix(caldav): Close DB cursor in reminder index background job
-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; } } |