Skip to content

Better logging of paused Hooks when ActionScheduler is used to run them #206

@JanThiel

Description

@JanThiel

Due to the way the Crontrol "Pauser" works by injecting just another regular action with a priority of -9999 all executions in ActionScheduler are logged as "Completed".

This is kind of misleading as the actual, expected action is not executed at all. Only the runtime of 0s might indicate something.

I am not quite sure if this should be handled here or in AS and would like to open it up for discussion.

As AS supports proper Exceptions, simply throwing an Exception with a Message "Paused by WP-Crontrol" in the Crontrol Pauser would do the trick. This would result in marking the execution in AS as "failed" with the Message of the Exception in the AS logs.

The other solution in AS would actually require checking for the registered Actions to see if the first one is the Pauser. So I believe the better way would be to to handle it within the Crontrol Pauser explicitly.

What do you think?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions