diff options
author | Roeland Jago Douma <rullzer@users.noreply.github.com> | 2017-04-05 15:21:38 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-04-05 15:21:38 +0200 |
commit | 00558de782e93d2f5b7d73c0197fdf38261003f9 (patch) | |
tree | d358ad5f29492bbbb3335684101a20e6a626aa55 | |
parent | 98312a9a58ad4b4990648d5b4ee9aaf711bca035 (diff) | |
parent | 738730f7b280884cc89c272bbab2a21caa8a24dd (diff) | |
download | nextcloud-server-00558de782e93d2f5b7d73c0197fdf38261003f9.tar.gz nextcloud-server-00558de782e93d2f5b7d73c0197fdf38261003f9.zip |
Merge pull request #3781 from nextcloud/fac-56-log-spam-with-external-storages
Also add the root of external storages to the file id list
-rw-r--r-- | apps/workflowengine/lib/Check/FileSystemTags.php | 18 |
1 files changed, 13 insertions, 5 deletions
diff --git a/apps/workflowengine/lib/Check/FileSystemTags.php b/apps/workflowengine/lib/Check/FileSystemTags.php index e9b5a945967..4a2b87fd53e 100644 --- a/apps/workflowengine/lib/Check/FileSystemTags.php +++ b/apps/workflowengine/lib/Check/FileSystemTags.php @@ -23,6 +23,7 @@ namespace OCA\WorkflowEngine\Check; use OCP\Files\Cache\ICache; +use OCP\Files\IHomeStorage; use OCP\Files\Storage\IStorage; use OCP\IL10N; use OCP\SystemTag\ISystemTagManager; @@ -108,7 +109,7 @@ class FileSystemTags implements ICheck { */ protected function getSystemTags() { $cache = $this->storage->getCache(); - $fileIds = $this->getFileIds($cache, $this->path); + $fileIds = $this->getFileIds($cache, $this->path, !$this->storage->instanceOfStorage(IHomeStorage::class)); $systemTags = []; foreach ($fileIds as $i => $fileId) { @@ -135,17 +136,19 @@ class FileSystemTags implements ICheck { * Get the file ids of the given path and its parents * @param ICache $cache * @param string $path + * @param bool $isExternalStorage * @return int[] */ - protected function getFileIds(ICache $cache, $path) { + protected function getFileIds(ICache $cache, $path, $isExternalStorage) { $cacheId = $cache->getNumericStorageId(); if (isset($this->fileIds[$cacheId][$path])) { return $this->fileIds[$cacheId][$path]; } - if ($path !== dirname($path)) { - $parentIds = $this->getFileIds($cache, dirname($path)); - } else { + $parentIds = []; + if ($path !== $this->dirname($path)) { + $parentIds = $this->getFileIds($cache, $this->dirname($path), $isExternalStorage); + } else if (!$isExternalStorage) { return []; } @@ -158,4 +161,9 @@ class FileSystemTags implements ICheck { return $parentIds; } + + protected function dirname($path) { + $dir = dirname($path); + return $dir === '.' ? '' : $dir; + } } |