Skip to content

Commit

Permalink
Merge pull request #44151 from nextcloud/fix/go-back-to-job-execute
Browse files Browse the repository at this point in the history
  • Loading branch information
Altahrim authored Mar 12, 2024
2 parents c423973 + 65bad47 commit 0b4b50d
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
3 changes: 2 additions & 1 deletion core/Command/Background/Job.php
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,8 @@ protected function execute(InputInterface $input, OutputInterface $output): int
$output->writeln('<error>Something went wrong when trying to retrieve Job with ID ' . $jobId . ' from database</error>');
return 1;
}
$job->start($this->jobList);
/** @psalm-suppress DeprecatedMethod 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())) {
Expand Down
6 changes: 4 additions & 2 deletions cron.php
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,8 @@
$memoryBefore = memory_get_usage();
$memoryPeakBefore = memory_get_peak_usage();

$job->start($jobList);
/** @psalm-suppress DeprecatedMethod Calling execute until it is removed, then will switch to start */
$job->execute($jobList);

$memoryAfter = memory_get_usage();
$memoryPeakAfter = memory_get_peak_usage();
Expand Down Expand Up @@ -207,7 +208,8 @@
$job = $jobList->getNext();
if ($job != null) {
$logger->debug('WebCron call has selected job with ID ' . strval($job->getId()), ['app' => 'cron']);
$job->start($jobList);
/** @psalm-suppress DeprecatedMethod Calling execute until it is removed, then will switch to start */
$job->execute($jobList);
$jobList->setLastJob($job);
}
OC_JSON::success();
Expand Down

0 comments on commit 0b4b50d

Please sign in to comment.