Skip to content

Commit dba9377

Browse files
committed
Assume an action is valid until proven otherwise
This way, if an error is thrown before the validation happens, the error handler will still attempt to set the action's status as failed instead of just skipping over it. Fixes #1245
1 parent d0a539e commit dba9377

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

classes/abstracts/ActionScheduler_Abstract_QueueRunner.php

+3-2
Original file line numberDiff line numberDiff line change
@@ -86,15 +86,16 @@ function ( $type, $message ) {
8686
*/
8787
try {
8888
try {
89-
$valid_action = false;
89+
$valid_action = true;
90+
9091
do_action( 'action_scheduler_before_execute', $action_id, $context );
9192

9293
if ( ActionScheduler_Store::STATUS_PENDING !== $this->store->get_status( $action_id ) ) {
94+
$valid_action = false;
9395
do_action( 'action_scheduler_execution_ignored', $action_id, $context );
9496
return;
9597
}
9698

97-
$valid_action = true;
9899
do_action( 'action_scheduler_begin_execute', $action_id, $context );
99100

100101
$action = $this->store->fetch_action( $action_id );

0 commit comments

Comments
 (0)