Uploaded image for project: 'CiviCRM'
  1. CiviCRM
  2. CRM-21460

Programmatic access to job execution status

    Details

    • Type: Improvement
    • Status: Done/Fixed
    • Priority: Minor
    • Resolution: Fixed/Completed
    • Affects Version/s: 4.7.27
    • Fix Version/s: 5.4
    • Component/s: Core CiviCRM
    • Labels:
    • Versioning Impact:
      Minor (add functionality in backwards-compatible manner)
    • Documentation Required?:
      Developer Doc
    • Funding Source:
      Contributed Code
    • Verified?:
      No

      Description

      It would be useful to know the result of the execution of a scheduled job in a programmatic manner, for example to display all the jobs that failed previous night, or send an alert when some job fails. At the moment the job log does not store any structured information about the execution status, only a message in a freetext format.

      I think the easiest and most flexible solution would be to add a hook after the execution of the job, e.g.: hook_civicrm_postExecute($job, $result).

      I am happy to write the code and PR, but would love some feedback on whether this is the best direction to take.

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              romain Romain Thouvenin
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: