diff options
author | Julius Härtl <jus@bitgrid.net> | 2021-08-26 21:37:07 +0200 |
---|---|---|
committer | Julius Härtl <jus@bitgrid.net> | 2021-08-26 22:03:05 +0200 |
commit | 0670118470a9133749d630078f8b69d0e62c3e52 (patch) | |
tree | 326faaac2cff19b6334e3360c6fe77b17c2f61aa /lib/private | |
parent | fd93aa816231954ca628daa85bd091fd6ff3a570 (diff) | |
download | nextcloud-server-0670118470a9133749d630078f8b69d0e62c3e52.tar.gz nextcloud-server-0670118470a9133749d630078f8b69d0e62c3e52.zip |
Use storage filter when fetching previews to cleanup
Signed-off-by: Julius Härtl <jus@bitgrid.net>
Diffstat (limited to 'lib/private')
-rw-r--r-- | lib/private/Files/AppData/AppData.php | 2 | ||||
-rw-r--r-- | lib/private/Preview/BackgroundCleanupJob.php | 1 | ||||
-rw-r--r-- | lib/private/Preview/Storage/Root.php | 4 |
3 files changed, 6 insertions, 1 deletions
diff --git a/lib/private/Files/AppData/AppData.php b/lib/private/Files/AppData/AppData.php index df72978a142..53f69be7127 100644 --- a/lib/private/Files/AppData/AppData.php +++ b/lib/private/Files/AppData/AppData.php @@ -79,7 +79,7 @@ class AppData implements IAppData { return 'appdata_' . $instanceId; } - private function getAppDataRootFolder(): Folder { + protected function getAppDataRootFolder(): Folder { $name = $this->getAppDataFolderName(); try { diff --git a/lib/private/Preview/BackgroundCleanupJob.php b/lib/private/Preview/BackgroundCleanupJob.php index c78ef7d7257..ab40aeaaa79 100644 --- a/lib/private/Preview/BackgroundCleanupJob.php +++ b/lib/private/Preview/BackgroundCleanupJob.php @@ -134,6 +134,7 @@ class BackgroundCleanupJob extends TimedJob { )) ->where( $qb->expr()->andX( + $qb->expr()->eq('a.storage', $qb->createNamedParameter($this->previewFolder->getStorageId())), $qb->expr()->isNull('b.fileid'), $qb->expr()->like('a.path', $qb->createNamedParameter($like)), $qb->expr()->eq('a.mimetype', $qb->createNamedParameter($this->mimeTypeLoader->getId('httpd/unix-directory'))) diff --git a/lib/private/Preview/Storage/Root.php b/lib/private/Preview/Storage/Root.php index 0eac3ce2064..c4191228ec7 100644 --- a/lib/private/Preview/Storage/Root.php +++ b/lib/private/Preview/Storage/Root.php @@ -85,4 +85,8 @@ class Root extends AppData { public static function getInternalFolder(string $name): string { return implode('/', str_split(substr(md5($name), 0, 7))) . '/' . $name; } + + public function getStorageId(): int { + return $this->getAppDataRootFolder()->getStorage()->getCache()->getNumericStorageId(); + } } |