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
break; | break; | ||||
} | } | ||||
$logger->debug('CLI cron call has selected job with ID ' . strval($job->getId()), ['app' => 'cron']); | |||||
$job->execute($jobList, $logger); | $job->execute($jobList, $logger); | ||||
// clean up after unclean jobs | // clean up after unclean jobs | ||||
\OC_Util::tearDownFS(); | \OC_Util::tearDownFS(); | ||||
$jobList = \OC::$server->getJobList(); | $jobList = \OC::$server->getJobList(); | ||||
$job = $jobList->getNext(); | $job = $jobList->getNext(); | ||||
if ($job != null) { | if ($job != null) { | ||||
$logger->debug('WebCron call has selected job with ID ' . strval($job->getId()), ['app' => 'cron']); | |||||
$job->execute($jobList, $logger); | $job->execute($jobList, $logger); | ||||
$jobList->setLastJob($job); | $jobList->setLastJob($job); | ||||
} | } |
* @param bool $onlyTimeSensitive | * @param bool $onlyTimeSensitive | ||||
* @return IJob|null | * @return IJob|null | ||||
*/ | */ | ||||
public function getNext(bool $onlyTimeSensitive = true): ?IJob { | |||||
public function getNext(bool $onlyTimeSensitive = false): ?IJob { | |||||
$query = $this->connection->getQueryBuilder(); | $query = $this->connection->getQueryBuilder(); | ||||
$query->select('*') | $query->select('*') | ||||
->from('jobs') | ->from('jobs') |
* @param bool $onlyTimeSensitive | * @param bool $onlyTimeSensitive | ||||
* @return IJob|null | * @return IJob|null | ||||
*/ | */ | ||||
public function getNext(bool $onlyTimeSensitive = true): ?IJob { | |||||
public function getNext(bool $onlyTimeSensitive = false): ?IJob { | |||||
if (count($this->jobs) > 0) { | if (count($this->jobs) > 0) { | ||||
if ($this->last < (count($this->jobs) - 1)) { | if ($this->last < (count($this->jobs) - 1)) { | ||||
$i = $this->last + 1; | $i = $this->last + 1; |