Skip to content

Commit

Permalink
Merge pull request #41325 from nextcloud/backport/40995/stable26
Browse files Browse the repository at this point in the history
[stable26] optimize cache jail creation
  • Loading branch information
icewind1991 authored Nov 9, 2023
2 parents 6b47154 + 6f7f521 commit e794e7d
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 e794e7d

Please sign in to comment.