Problem/Motivation

The loadLatestLogEntry does not provide the latest log entry, It is because the log entry is not finished yet at the time of hook_cron_post_run.

Steps to reproduce

Implement hook_cron_post_run, and try to get the latest log entry by calling $job->loadLatestLogEntry()

Proposed resolution

The proposed solution is that call the finish method of the log entry before invoking the cron_last_run.

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

hmdnawaz created an issue. See original summary.

hmdnawaz’s picture

hmdnawaz’s picture

Status: Active » Needs review
monymirza’s picture

Status: Needs review » Reviewed & tested by the community

Berdir made their first commit to this issue’s fork.

  • Berdir committed 3761c36b on 8.x-2.x authored by hmdnawaz
    Issue #3294129 by hmdnawaz: The loadLatestLogEntry does not provide the...
berdir’s picture

Status: Reviewed & tested by the community » Fixed

Why not, although wondering if it wouldn't make more sense to pass the log entry along to the hook instead. But committed.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.