Close cursors
This commit is contained in:
parent
5b8c7768b1
commit
884e538575
|
@ -572,7 +572,7 @@ class CalDavBackend extends AbstractBackend implements SyncSupport, Subscription
|
||||||
}
|
}
|
||||||
|
|
||||||
$chunks = array_chunk($uris, 100);
|
$chunks = array_chunk($uris, 100);
|
||||||
$result = [];
|
$objects = [];
|
||||||
|
|
||||||
$query = $this->db->getQueryBuilder();
|
$query = $this->db->getQueryBuilder();
|
||||||
$query->select(['id', 'uri', 'lastmodified', 'etag', 'calendarid', 'size', 'calendardata', 'componenttype', 'classification'])
|
$query->select(['id', 'uri', 'lastmodified', 'etag', 'calendarid', 'size', 'calendardata', 'componenttype', 'classification'])
|
||||||
|
@ -582,10 +582,10 @@ class CalDavBackend extends AbstractBackend implements SyncSupport, Subscription
|
||||||
|
|
||||||
foreach ($chunks as $uris) {
|
foreach ($chunks as $uris) {
|
||||||
$query->setParameter('uri', $uris, IQueryBuilder::PARAM_STR_ARRAY);
|
$query->setParameter('uri', $uris, IQueryBuilder::PARAM_STR_ARRAY);
|
||||||
$stmt = $query->execute();
|
$result = $query->execute();
|
||||||
|
|
||||||
while($row = $stmt->fetch(\PDO::FETCH_ASSOC)) {
|
while ($row = $result->fetch()) {
|
||||||
$result[] = [
|
$objects[] = [
|
||||||
'id' => $row['id'],
|
'id' => $row['id'],
|
||||||
'uri' => $row['uri'],
|
'uri' => $row['uri'],
|
||||||
'lastmodified' => $row['lastmodified'],
|
'lastmodified' => $row['lastmodified'],
|
||||||
|
@ -597,8 +597,9 @@ class CalDavBackend extends AbstractBackend implements SyncSupport, Subscription
|
||||||
'classification' => (int)$row['classification']
|
'classification' => (int)$row['classification']
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
$result->closeCursor();
|
||||||
}
|
}
|
||||||
return $result;
|
return $objects;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -456,11 +456,12 @@ class CardDavBackend implements BackendInterface, SyncSupport {
|
||||||
$query->setParameter('uri', $uris, IQueryBuilder::PARAM_STR_ARRAY);
|
$query->setParameter('uri', $uris, IQueryBuilder::PARAM_STR_ARRAY);
|
||||||
$result = $query->execute();
|
$result = $query->execute();
|
||||||
|
|
||||||
while($row = $result->fetch()) {
|
while ($row = $result->fetch()) {
|
||||||
$row['etag'] = '"' . $row['etag'] . '"';
|
$row['etag'] = '"' . $row['etag'] . '"';
|
||||||
$row['carddata'] = $this->readBlob($row['carddata']);
|
$row['carddata'] = $this->readBlob($row['carddata']);
|
||||||
$cards[] = $row;
|
$cards[] = $row;
|
||||||
}
|
}
|
||||||
|
$result->closeCursor();
|
||||||
}
|
}
|
||||||
return $cards;
|
return $cards;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue