Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 7 additions & 3 deletions lib/private/Files/Cache/Cache.php
Original file line number Diff line number Diff line change
Expand Up @@ -62,14 +62,15 @@ class Cache implements ICache {
*/
protected array $partial = [];
protected string $storageId;
protected Storage $storageCache;
protected ?Storage $storageCache = null;
protected IMimeTypeLoader $mimetypeLoader;
protected IDBConnection $connection;
protected SystemConfig $systemConfig;
protected LoggerInterface $logger;
protected QuerySearchHelper $querySearchHelper;
protected IEventDispatcher $eventDispatcher;
protected IFilesMetadataManager $metadataManager;
private CacheDependencies $cacheDependencies;

public function __construct(
private IStorage $storage,
Expand All @@ -84,7 +85,7 @@ public function __construct(
if (!$dependencies) {
$dependencies = Server::get(CacheDependencies::class);
}
$this->storageCache = new Storage($this->storage, true, $dependencies->getConnection());
$this->cacheDependencies = $dependencies;
$this->mimetypeLoader = $dependencies->getMimeTypeLoader();
$this->connection = $dependencies->getConnection();
$this->systemConfig = $dependencies->getSystemConfig();
Expand All @@ -102,6 +103,9 @@ protected function getQueryBuilder() {
}

public function getStorageCache(): Storage {
if (!$this->storageCache) {
$this->storageCache = new Storage($this->storage, true, $this->cacheDependencies->getConnection());
}
return $this->storageCache;
}

Expand All @@ -112,7 +116,7 @@ public function getStorageCache(): Storage {
*/
#[\Override]
public function getNumericStorageId() {
return $this->storageCache->getNumericId();
return $this->getStorageCache()->getNumericId();
}

/**
Expand Down
Loading