mirror of
https://github.com/nextcloud/server.git
synced 2026-06-08 16:26:59 -04:00
fix: Call execute until it is removed for Job class
Because if an application extends execute it will change behavior without warning otherwise. Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
This commit is contained in:
parent
9a5272870c
commit
75751d51de
2 changed files with 6 additions and 3 deletions
|
|
@ -84,7 +84,8 @@ class Job extends Command {
|
|||
$output->writeln('<error>Something went wrong when trying to retrieve Job with ID ' . $jobId . ' from database</error>');
|
||||
return 1;
|
||||
}
|
||||
$job->start($this->jobList);
|
||||
/** Calling execute until it is removed, then will switch to start */
|
||||
$job->execute($this->jobList);
|
||||
$job = $this->jobList->getById($jobId);
|
||||
|
||||
if (($job === null) || ($lastRun !== $job->getLastRun())) {
|
||||
|
|
|
|||
6
cron.php
6
cron.php
|
|
@ -172,7 +172,8 @@ try {
|
|||
$memoryBefore = memory_get_usage();
|
||||
$memoryPeakBefore = memory_get_peak_usage();
|
||||
|
||||
$job->start($jobList);
|
||||
/** Calling execute until it is removed, then will switch to start */
|
||||
$job->execute($jobList);
|
||||
|
||||
$memoryAfter = memory_get_usage();
|
||||
$memoryPeakAfter = memory_get_peak_usage();
|
||||
|
|
@ -207,7 +208,8 @@ try {
|
|||
$job = $jobList->getNext();
|
||||
if ($job != null) {
|
||||
$logger->debug('WebCron call has selected job with ID ' . strval($job->getId()), ['app' => 'cron']);
|
||||
$job->start($jobList);
|
||||
/** Calling execute until it is removed, then will switch to start */
|
||||
$job->execute($jobList);
|
||||
$jobList->setLastJob($job);
|
||||
}
|
||||
OC_JSON::success();
|
||||
|
|
|
|||
Loading…
Reference in a new issue