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?
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
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.
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.