aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorJulius Härtl <jus@bitgrid.net>2021-12-28 13:20:02 +0100
committerGitHub <noreply@github.com>2021-12-28 13:20:02 +0100
commit6f986519fe31a801099288a073ffcd9f22242126 (patch)
treea0b535be3ed5ead55e910a31e5c9780e826702f8 /lib
parent66ca9baed292e30e2354df0aa4f65742f27c28ce (diff)
parent0670118470a9133749d630078f8b69d0e62c3e52 (diff)
downloadnextcloud-server-6f986519fe31a801099288a073ffcd9f22242126.tar.gz
nextcloud-server-6f986519fe31a801099288a073ffcd9f22242126.zip
Merge pull request #28610 from nextcloud/enh/preview-cleanup-query
Diffstat (limited to 'lib')
-rw-r--r--lib/private/Files/AppData/AppData.php2
-rw-r--r--lib/private/Preview/BackgroundCleanupJob.php1
-rw-r--r--lib/private/Preview/Storage/Root.php4
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();
+ }
}