Skip to content
Snippets Groups Projects
Unverified Commit bde791ce authored by Robin Appelman's avatar Robin Appelman
Browse files

use eq instead of in for loading single storage


Signed-off-by: default avatarRobin Appelman <robin@icewind.nl>
parent 1a8f9b8b
No related branches found
No related tags found
No related merge requests found
......@@ -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;
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment