diff options
author | Git'Fellow <12234510+solracsf@users.noreply.github.com> | 2024-10-16 10:41:21 +0200 |
---|---|---|
committer | Git'Fellow <12234510+solracsf@users.noreply.github.com> | 2024-10-16 18:30:53 +0200 |
commit | 70db9dc5369142526f74a4aa39e2a9ba92af9d8e (patch) | |
tree | ef58139898ff8f1c421fbfb8674877a8f2f59bcc /lib/private/Preview | |
parent | 94e1241c589e13464a958b29052739a354aadddd (diff) | |
download | nextcloud-server-dbQueriesExecStmt.tar.gz nextcloud-server-dbQueriesExecStmt.zip |
chore(db): Correctly apply query typesdbQueriesExecStmt
fix: psalm
fix: error
fix: add batch
fix: fatal error
fix: add batch
chore: add batch
chore: add batch
fix: psalm
fix: typo
fix: psalm
fix: return bool
fix: revert Manager
Diffstat (limited to 'lib/private/Preview')
-rw-r--r-- | lib/private/Preview/BackgroundCleanupJob.php | 34 |
1 files changed, 10 insertions, 24 deletions
diff --git a/lib/private/Preview/BackgroundCleanupJob.php b/lib/private/Preview/BackgroundCleanupJob.php index ad5e793474b..e816ae22743 100644 --- a/lib/private/Preview/BackgroundCleanupJob.php +++ b/lib/private/Preview/BackgroundCleanupJob.php @@ -18,32 +18,18 @@ use OCP\Files\NotPermittedException; use OCP\IDBConnection; class BackgroundCleanupJob extends TimedJob { - /** @var IDBConnection */ - private $connection; - /** @var Root */ - private $previewFolder; - - /** @var bool */ - private $isCLI; - - /** @var IMimeTypeLoader */ - private $mimeTypeLoader; - - public function __construct(ITimeFactory $timeFactory, - IDBConnection $connection, - Root $previewFolder, - IMimeTypeLoader $mimeTypeLoader, - bool $isCLI) { + public function __construct( + ITimeFactory $timeFactory, + private IDBConnection $connection, + private Root $previewFolder, + private IMimeTypeLoader $mimeTypeLoader, + private bool $isCLI, + ) { parent::__construct($timeFactory); // Run at most once an hour $this->setInterval(60 * 60); $this->setTimeSensitivity(self::TIME_INSENSITIVE); - - $this->connection = $connection; - $this->previewFolder = $previewFolder; - $this->isCLI = $isCLI; - $this->mimeTypeLoader = $mimeTypeLoader; } public function run($argument) { @@ -90,7 +76,7 @@ class BackgroundCleanupJob extends TimedJob { $qb->setMaxResults(10); } - $cursor = $qb->execute(); + $cursor = $qb->executeQuery(); while ($row = $cursor->fetch()) { yield $row['name']; @@ -104,7 +90,7 @@ class BackgroundCleanupJob extends TimedJob { $qb->select('path', 'mimetype') ->from('filecache') ->where($qb->expr()->eq('fileid', $qb->createNamedParameter($this->previewFolder->getId()))); - $cursor = $qb->execute(); + $cursor = $qb->executeQuery(); $data = $cursor->fetch(); $cursor->closeCursor(); @@ -162,7 +148,7 @@ class BackgroundCleanupJob extends TimedJob { $qb->setMaxResults(10); } - $cursor = $qb->execute(); + $cursor = $qb->executeQuery(); while ($row = $cursor->fetch()) { yield $row['name']; |