Simple cron should log failed executions.

Created on 3 August 2023, 11 months ago
Updated 5 January 2024, 6 months ago

Problem/Motivation

I only see log entries about successful job executions, could simple cron also log failed executions (with a error or warning level)?

Proposed resolution

\Drupal\simple_cron\Plugin\SimpleCronPluginInterface::process should return a true/false according to execution.

\Drupal\simple_cron\Entity\CronJob::run should log an error on FALSE :

  if ($plugin->process() === FALSE) {
     $this->getLogger('simple_cron')->error(Execution of cron job @job. failed', ['@job' => $this->id()]);
  }

API changes

SimpleCronPluginInterface's Process method should now return FALSE on error, TRUE on success (or void for retro-compatibility reason)

Remaining tasks

  • Maintainer should approuve this API change
  • Propose a MR
✨ Feature request
Status

Needs work

Version

1.1

Component

Code

Created by

🇫🇷France O'Briat Nantes

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Production build 0.69.0 2024