diff options
author | Joas Schilling <coding@schilljs.com> | 2020-11-05 10:50:53 +0100 |
---|---|---|
committer | Joas Schilling <coding@schilljs.com> | 2020-11-09 12:28:17 +0100 |
commit | 8027dcbc6f6b1653f5ebcf04b1862ac1e1f51d32 (patch) | |
tree | 1bf182f477bfbead7b75ae14a8cd0fce5bb38ada /lib/private/Files/Cache/StorageGlobal.php | |
parent | 72545ffd07a07f142c9c18b3e4afc9ae1b5c8da2 (diff) | |
download | nextcloud-server-8027dcbc6f6b1653f5ebcf04b1862ac1e1f51d32.tar.gz nextcloud-server-8027dcbc6f6b1653f5ebcf04b1862ac1e1f51d32.zip |
Don't leave cursors open when tests fail
Signed-off-by: Joas Schilling <coding@schilljs.com>
Diffstat (limited to 'lib/private/Files/Cache/StorageGlobal.php')
-rw-r--r-- | lib/private/Files/Cache/StorageGlobal.php | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/lib/private/Files/Cache/StorageGlobal.php b/lib/private/Files/Cache/StorageGlobal.php index 26a7be24634..8bf37514b8b 100644 --- a/lib/private/Files/Cache/StorageGlobal.php +++ b/lib/private/Files/Cache/StorageGlobal.php @@ -61,6 +61,7 @@ class StorageGlobal { while ($row = $result->fetch()) { $this->cache[$row['id']] = $row; } + $result->closeCursor(); } /** @@ -74,7 +75,10 @@ class StorageGlobal { ->from('storages') ->where($builder->expr()->eq('id', $builder->createNamedParameter($storageId))); - $row = $query->execute()->fetch(); + $result = $query->execute(); + $row = $result->fetch(); + $result->closeCursor(); + if ($row) { $this->cache[$storageId] = $row; } |