]> source.dussan.org Git - nextcloud-server.git/commitdiff
JobList: add debug log when hasReservedJob query fails
authorMarcel Klehr <mklehr@gmx.net>
Mon, 24 Apr 2023 15:16:15 +0000 (17:16 +0200)
committerMarcel Klehr <mklehr@gmx.net>
Mon, 24 Apr 2023 15:16:32 +0000 (17:16 +0200)
Signed-off-by: Marcel Klehr <mklehr@gmx.net>
lib/private/BackgroundJob/JobList.php

index 3846aed3d61ba9d08c552e32b6e022e98587813a..fbeee1f56e94c9018a277e07bc59862fe319a195 100644 (file)
@@ -39,16 +39,19 @@ use OCP\DB\Exception;
 use OCP\DB\QueryBuilder\IQueryBuilder;
 use OCP\IConfig;
 use OCP\IDBConnection;
+use Psr\Log\LoggerInterface;
 
 class JobList implements IJobList {
        protected IDBConnection $connection;
        protected IConfig $config;
        protected ITimeFactory $timeFactory;
+       protected LoggerInterface $logger;
 
-       public function __construct(IDBConnection $connection, IConfig $config, ITimeFactory $timeFactory) {
+       public function __construct(IDBConnection $connection, IConfig $config, ITimeFactory $timeFactory, LoggerInterface $logger) {
                $this->connection = $connection;
                $this->config = $config;
                $this->timeFactory = $timeFactory;
+               $this->logger = $logger;
        }
 
        /**
@@ -401,6 +404,7 @@ class JobList implements IJobList {
                        $result->closeCursor();
                        return $hasReservedJobs;
                } catch (Exception $e) {
+                       $this->logger->debug('Querying reserved jobs failed', ['exception' => $e]);
                        return false;
                }
        }