Browse Source
Move to join
Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
pull/9420/head
Roeland Jago Douma
8 years ago
No known key found for this signature in database
GPG Key ID: F941078878347C0C
1 changed files with
8 additions and
8 deletions
-
lib/private/Preview/BackgroundCleanupJob.php
|
|
|
@ -25,6 +25,7 @@ namespace OC\Preview; |
|
|
|
|
|
|
|
use OC\BackgroundJob\TimedJob; |
|
|
|
use OC\Files\AppData\Factory; |
|
|
|
use OCP\DB\QueryBuilder\IQueryBuilder; |
|
|
|
use OCP\Files\NotFoundException; |
|
|
|
use OCP\Files\NotPermittedException; |
|
|
|
use OCP\IDBConnection; |
|
|
|
@ -56,17 +57,16 @@ class BackgroundCleanupJob extends TimedJob { |
|
|
|
|
|
|
|
$previewFodlerId = $previews->getId(); |
|
|
|
|
|
|
|
$qb2 = $this->connection->getQueryBuilder(); |
|
|
|
$qb2->select('fileid') |
|
|
|
->from('filecache'); |
|
|
|
|
|
|
|
$qb = $this->connection->getQueryBuilder(); |
|
|
|
$qb->select('name') |
|
|
|
->from('filecache') |
|
|
|
$qb->select('a.name') |
|
|
|
->from('filecache', 'a') |
|
|
|
->leftJoin('a', 'filecache', 'b', $qb->expr()->eq( |
|
|
|
$qb->expr()->castColumn('a.name', IQueryBuilder::PARAM_INT), 'b.fileid' |
|
|
|
)) |
|
|
|
->where( |
|
|
|
$qb->expr()->eq('parent', $qb->createNamedParameter($previewFodlerId)) |
|
|
|
$qb->expr()->isNull('b.fileid') |
|
|
|
)->andWhere( |
|
|
|
$qb->expr()->notIn('name', $qb->createFunction($qb2->getSQL())) |
|
|
|
$qb->expr()->eq('a.parent', $qb->createNamedParameter($previewFodlerId)) |
|
|
|
); |
|
|
|
|
|
|
|
if (!$this->isCLI) { |
|
|
|
|