Skip to content

Commit

Permalink
Merge pull request #41324 from nextcloud/backport/40995/stable27
Browse files Browse the repository at this point in the history
[stable27] optimize cache jail creation
  • Loading branch information
icewind1991 committed Nov 9, 2023
2 parents 11ec6a7 + 204aedc commit 6250c7d
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 6 deletions.
2 changes: 0 additions & 2 deletions lib/private/Files/Cache/Wrapper/CacheJail.php
Expand Up @@ -52,8 +52,6 @@ class CacheJail extends CacheWrapper {
public function __construct($cache, $root) {
parent::__construct($cache);
$this->root = $root;
$this->connection = \OC::$server->getDatabaseConnection();
$this->mimetypeLoader = \OC::$server->getMimeTypeLoader();

if ($cache instanceof CacheJail) {
$this->unjailedRoot = $cache->getSourcePath($root);
Expand Down
5 changes: 1 addition & 4 deletions lib/private/Files/Storage/Wrapper/Jail.php
Expand Up @@ -396,10 +396,7 @@ public function hasUpdated($path, $time) {
* @return \OC\Files\Cache\Cache
*/
public function getCache($path = '', $storage = null) {
if (!$storage) {
$storage = $this->getWrapperStorage();
}
$sourceCache = $this->getWrapperStorage()->getCache($this->getUnjailedPath($path), $storage);
$sourceCache = $this->getWrapperStorage()->getCache($this->getUnjailedPath($path));
return new CacheJail($sourceCache, $this->rootPath);
}

Expand Down

0 comments on commit 6250c7d

Please sign in to comment.