mirror of
https://github.com/nextcloud/server.git
synced 2026-04-29 18:11:41 -04:00
fix(caldav): Close DB cursor in reminder index background job
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
This commit is contained in:
parent
67155c6de9
commit
aa5ae7ccf5
1 changed files with 4 additions and 2 deletions
|
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue