Merge pull request #13752 from owncloud/closecursor1
Close cursor early in calculateFolderSize
This commit is contained in:
commit
acf0582029
|
@ -596,6 +596,7 @@ class Cache {
|
||||||
'WHERE `parent` = ? AND `storage` = ?';
|
'WHERE `parent` = ? AND `storage` = ?';
|
||||||
$result = \OC_DB::executeAudited($sql, array($id, $this->getNumericStorageId()));
|
$result = \OC_DB::executeAudited($sql, array($id, $this->getNumericStorageId()));
|
||||||
if ($row = $result->fetchRow()) {
|
if ($row = $result->fetchRow()) {
|
||||||
|
$result->closeCursor();
|
||||||
list($sum, $min, $unencryptedSum) = array_values($row);
|
list($sum, $min, $unencryptedSum) = array_values($row);
|
||||||
$sum = 0 + $sum;
|
$sum = 0 + $sum;
|
||||||
$min = 0 + $min;
|
$min = 0 + $min;
|
||||||
|
@ -618,6 +619,8 @@ class Cache {
|
||||||
if ($totalSize !== -1 and $unencryptedSum > 0) {
|
if ($totalSize !== -1 and $unencryptedSum > 0) {
|
||||||
$totalSize = $unencryptedSum;
|
$totalSize = $unencryptedSum;
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
$result->closeCursor();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return $totalSize;
|
return $totalSize;
|
||||||
|
|
|
@ -35,6 +35,7 @@ class HomeCache extends Cache {
|
||||||
'WHERE `parent` = ? AND `storage` = ? AND `size` >= 0';
|
'WHERE `parent` = ? AND `storage` = ? AND `size` >= 0';
|
||||||
$result = \OC_DB::executeAudited($sql, array($id, $this->getNumericStorageId()));
|
$result = \OC_DB::executeAudited($sql, array($id, $this->getNumericStorageId()));
|
||||||
if ($row = $result->fetchRow()) {
|
if ($row = $result->fetchRow()) {
|
||||||
|
$result->closeCursor();
|
||||||
list($sum, $unencryptedSum) = array_values($row);
|
list($sum, $unencryptedSum) = array_values($row);
|
||||||
$totalSize = 0 + $sum;
|
$totalSize = 0 + $sum;
|
||||||
$unencryptedSize = 0 + $unencryptedSum;
|
$unencryptedSize = 0 + $unencryptedSum;
|
||||||
|
|
Loading…
Reference in New Issue