Skip to content

Commit

Permalink
Merge pull request #40995 from nextcloud/cache-jail-optimizations
Browse files Browse the repository at this point in the history
optimize cache jail creation
  • Loading branch information
blizzz authored Nov 3, 2023
2 parents 86e9fca + 4603443 commit 333ab4d
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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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 333ab4d

Please sign in to comment.