瀏覽代碼

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 <kirill.s.popov@gmail.com>
tags/v25.0.0beta1
Kirill Popov 2 年之前
父節點
當前提交
0b27b9e658
共有 3 個檔案被更改,包括 4 行新增2 行删除
  1. 2
    0
      cron.php
  2. 1
    1
      lib/private/BackgroundJob/JobList.php
  3. 1
    1
      tests/lib/BackgroundJob/DummyJobList.php

+ 2
- 0
cron.php 查看文件

@@ -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);
}

+ 1
- 1
lib/private/BackgroundJob/JobList.php 查看文件

@@ -203,7 +203,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')

+ 1
- 1
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;

Loading…
取消
儲存