summaryrefslogtreecommitdiffstats
path: root/lib/private/files/cache/homecache.php
diff options
context:
space:
mode:
authorVincent Petry <pvince81@owncloud.com>2014-11-28 09:35:31 +0100
committerVincent Petry <pvince81@owncloud.com>2014-11-28 09:35:31 +0100
commit35ab770b1143b5ca4505d2aae889f5390e13cbb2 (patch)
treed53e776809e8db8f5de07b90fcf8585494efd74e /lib/private/files/cache/homecache.php
parent099d43b1f9300f508c1899d376ae5aef459894bb (diff)
downloadnextcloud-server-35ab770b1143b5ca4505d2aae889f5390e13cbb2.tar.gz
nextcloud-server-35ab770b1143b5ca4505d2aae889f5390e13cbb2.zip
Close cursor early in calculateFolderSize
This method triggers additional queries in $this->update() so to avoid potential database locks or delays, we close the cursor as soon as it is not needed any more
Diffstat (limited to 'lib/private/files/cache/homecache.php')
-rw-r--r--lib/private/files/cache/homecache.php1
1 files changed, 1 insertions, 0 deletions
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;