diff options
author | Morris Jobke <hey@morrisjobke.de> | 2015-01-29 14:23:16 +0100 |
---|---|---|
committer | Morris Jobke <hey@morrisjobke.de> | 2015-01-29 14:23:16 +0100 |
commit | acf058202912cc999351712964cc039f4930b029 (patch) | |
tree | d5ef6035fb940f33b291f24ddbff0ed37e337d29 /lib/private/files | |
parent | a685354aee0ab4939b71b18f627b867627d1cc30 (diff) | |
parent | 35ab770b1143b5ca4505d2aae889f5390e13cbb2 (diff) | |
download | nextcloud-server-acf058202912cc999351712964cc039f4930b029.tar.gz nextcloud-server-acf058202912cc999351712964cc039f4930b029.zip |
Merge pull request #13752 from owncloud/closecursor1
Close cursor early in calculateFolderSize
Diffstat (limited to 'lib/private/files')
-rw-r--r-- | lib/private/files/cache/cache.php | 3 | ||||
-rw-r--r-- | lib/private/files/cache/homecache.php | 1 |
2 files changed, 4 insertions, 0 deletions
diff --git a/lib/private/files/cache/cache.php b/lib/private/files/cache/cache.php index 8831320bcee..5438bdad5cb 100644 --- a/lib/private/files/cache/cache.php +++ b/lib/private/files/cache/cache.php @@ -596,6 +596,7 @@ class Cache { 'WHERE `parent` = ? AND `storage` = ?'; $result = \OC_DB::executeAudited($sql, array($id, $this->getNumericStorageId())); if ($row = $result->fetchRow()) { + $result->closeCursor(); list($sum, $min, $unencryptedSum) = array_values($row); $sum = 0 + $sum; $min = 0 + $min; @@ -618,6 +619,8 @@ class Cache { if ($totalSize !== -1 and $unencryptedSum > 0) { $totalSize = $unencryptedSum; } + } else { + $result->closeCursor(); } } return $totalSize; diff --git a/lib/private/files/cache/homecache.php b/lib/private/files/cache/homecache.php index 2b3967c8807..ad7f587b8b6 100644 --- a/lib/private/files/cache/homecache.php +++ b/lib/private/files/cache/homecache.php @@ -35,6 +35,7 @@ class HomeCache extends Cache { 'WHERE `parent` = ? AND `storage` = ? AND `size` >= 0'; $result = \OC_DB::executeAudited($sql, array($id, $this->getNumericStorageId())); if ($row = $result->fetchRow()) { + $result->closeCursor(); list($sum, $unencryptedSum) = array_values($row); $totalSize = 0 + $sum; $unencryptedSize = 0 + $unencryptedSum; |