diff options
author | Joas Schilling <213943+nickvergessen@users.noreply.github.com> | 2022-04-25 17:31:02 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-04-25 17:31:02 +0200 |
commit | 3330e01c57d21b8ed3ce585f2259e54778d3c00b (patch) | |
tree | a5cf7593eeed82b600cb79d9da36e295028732de | |
parent | 7c38eec48aed89995661c20e46c9473b2b182773 (diff) | |
parent | e864d4212ec80355fa568560cda37d59f3e7c46b (diff) | |
download | nextcloud-server-3330e01c57d21b8ed3ce585f2259e54778d3c00b.tar.gz nextcloud-server-3330e01c57d21b8ed3ce585f2259e54778d3c00b.zip |
Merge pull request #32131 from nextcloud/backport/32109/stable23
[stable23] Get not only time-sensitive next job from list but any when not in cron-mode
-rw-r--r-- | cron.php | 2 | ||||
-rw-r--r-- | lib/private/BackgroundJob/JobList.php | 2 | ||||
-rw-r--r-- | tests/lib/BackgroundJob/DummyJobList.php | 2 |
3 files changed, 4 insertions, 2 deletions
@@ -147,6 +147,7 @@ try { break; } + $logger->debug('CLI cron call has selected job with ID ' . strval($job->getId()), ['app' => 'cron']); $job->execute($jobList, $logger); // clean up after unclean jobs \OC_Util::tearDownFS(); @@ -169,6 +170,7 @@ try { $jobList = \OC::$server->getJobList(); $job = $jobList->getNext(); if ($job != null) { + $logger->debug('WebCron call has selected job with ID ' . strval($job->getId()), ['app' => 'cron']); $job->execute($jobList, $logger); $jobList->setLastJob($job); } diff --git a/lib/private/BackgroundJob/JobList.php b/lib/private/BackgroundJob/JobList.php index 67caea62af0..b4041025ad8 100644 --- a/lib/private/BackgroundJob/JobList.php +++ b/lib/private/BackgroundJob/JobList.php @@ -187,7 +187,7 @@ class JobList implements IJobList { * @param bool $onlyTimeSensitive * @return IJob|null */ - public function getNext(bool $onlyTimeSensitive = true): ?IJob { + public function getNext(bool $onlyTimeSensitive = false): ?IJob { $query = $this->connection->getQueryBuilder(); $query->select('*') ->from('jobs') diff --git a/tests/lib/BackgroundJob/DummyJobList.php b/tests/lib/BackgroundJob/DummyJobList.php index ec06203a477..0751409f62c 100644 --- a/tests/lib/BackgroundJob/DummyJobList.php +++ b/tests/lib/BackgroundJob/DummyJobList.php @@ -78,7 +78,7 @@ class DummyJobList extends \OC\BackgroundJob\JobList { * @param bool $onlyTimeSensitive * @return IJob|null */ - public function getNext(bool $onlyTimeSensitive = true): ?IJob { + public function getNext(bool $onlyTimeSensitive = false): ?IJob { if (count($this->jobs) > 0) { if ($this->last < (count($this->jobs) - 1)) { $i = $this->last + 1; |