Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Get not only time-sensitive next job from list but any
Before the change webcron used to select
**only** time-sensitive tasks.

Signed-off-by: Kirill Popov <[email protected]>
  • Loading branch information
k-popov authored and backportbot[bot] committed Apr 25, 2022
commit 651b7b21417d54924c2dcbfc0fbaf2b4ee2858f8
2 changes: 2 additions & 0 deletions cron.php
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,7 @@
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();
Expand All @@ -168,6 +169,7 @@
$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);
}
Expand Down
2 changes: 1 addition & 1 deletion lib/private/BackgroundJob/JobList.php
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@ public function getAll() {
* @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')
Expand Down
2 changes: 1 addition & 1 deletion tests/lib/BackgroundJob/DummyJobList.php
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ public function getAll() {
* @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;
Expand Down