• Resolved ddoddsr

    (@ddoddsr)


    How do I notify to Action that my process is complete?
    Or failing?
    I know that the process has run but the status stays as in-progress.

    Do I use the the action’s ID in some manner.

    • This topic was modified 3 years, 9 months ago by ddoddsr.
Viewing 6 replies - 1 through 6 (of 6 total)
  • Plugin Support 3 Sons Development – a11n

    (@3sonsdevelopment)

    Hi @ddoddsr,

    The documentation mentions using a callback like this:

    
    /**
     * A callback to run when the 'eg_midnight_log' scheduled action is run.
     */
    function eg_log_action_data() {
    	error_log( 'It is just after midnight on ' . date( 'Y-m-d' ) );
    }
    add_action( 'eg_midnight_log', 'eg_log_action_data' );
    

    https://actionscheduler.org/usage/

    Have you tried something like that?

    Plugin Support 3 Sons Development – a11n

    (@3sonsdevelopment)

    Hi @ddoddsr,

    It’s been a while since we heard from you, so I’m marking this thread resolved. Hopefully, you’ve been able to resolve this, but if you haven’t, please open up a new topic and we’ll be happy to help out.

    Cheers

    Thread Starter ddoddsr

    (@ddoddsr)

    Sorry for the delay,
    The question here is how to make the Action Scheduler screen reflect that a process has failed or is complete or still running.
    I see those status but in the callbacks I run but don’t see how that status is set.

    thanks

    I ran into this the other day, where I wanted to indicate an action had failed (couldn’t retrieve third-party data for example), and to mark it as failed, while enqueuing an async action to try again.

    Thread Starter ddoddsr

    (@ddoddsr)

    I have process that starts a scheduled item for an off-hours process I’ll call build-it-1.
    Build-it-1 runs and schedules build-it-2 which schedules build-it-3 & etc

    I know that the process build-it-1 has run because the last thing it does is schedule build-it-2 but the status stays as in-progress.

    I think I needed to return a true instead of just wp_die().

    @ddoddsr Oh yes, wp_die() will prevent AS from marking the action as completed. Remove that and see if that works.

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘How do I notify to Action that my process is complete?’ is closed to new replies.