summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorRobin Appelman <robin@icewind.nl>2019-09-24 19:22:36 +0200
committerRobin Appelman <robin@icewind.nl>2019-09-26 15:04:04 +0200
commitbde791cec95d6861856bb33b7bd3dcc629f593c9 (patch)
tree669413989f75890ba238fa1eb2f81eb73c1213c7 /lib
parent1a8f9b8b1dae03ac8784f98f416bac2e1bb6ce7a (diff)
downloadnextcloud-server-bde791cec95d6861856bb33b7bd3dcc629f593c9.tar.gz
nextcloud-server-bde791cec95d6861856bb33b7bd3dcc629f593c9.zip
use eq instead of in for loading single storage
Signed-off-by: Robin Appelman <robin@icewind.nl>
Diffstat (limited to 'lib')
-rw-r--r--lib/private/Files/Cache/StorageGlobal.php10
1 files changed, 9 insertions, 1 deletions
diff --git a/lib/private/Files/Cache/StorageGlobal.php b/lib/private/Files/Cache/StorageGlobal.php
index 65f689f1874..076b5b8f53d 100644
--- a/lib/private/Files/Cache/StorageGlobal.php
+++ b/lib/private/Files/Cache/StorageGlobal.php
@@ -69,7 +69,15 @@ class StorageGlobal {
*/
public function getStorageInfo($storageId) {
if (!isset($this->cache[$storageId])) {
- $this->loadForStorageIds([$storageId]);
+ $builder = $this->connection->getQueryBuilder();
+ $query = $builder->select(['id', 'numeric_id', 'available', 'last_checked'])
+ ->from('storages')
+ ->where($builder->expr()->eq('id', $builder->createNamedParameter($storageId)));
+
+ $row = $query->execute()->fetch();
+ if ($row) {
+ $this->cache[$storageId] = $row;
+ }
}
return isset($this->cache[$storageId]) ? $this->cache[$storageId] : null;
}