Skip to content

Commit

Permalink
add hooks
Browse files Browse the repository at this point in the history
  • Loading branch information
aiiddqd committed Jan 8, 2025
1 parent 3a15065 commit 3a4ec86
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions main.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
/*
Plugin Name: Action Scheduler as Worker
Description: Run Action Scheduler queue as worker mode (wp as-worker)
Version: 0.1.241201
Version: 0.9.250108
Author: aiiddqd
Author URI: https://github.com/aiiddqd/as-worker
*/
Expand Down Expand Up @@ -62,7 +62,7 @@
}

$jobsNumber = ActionScheduler_QueueRunner::instance()->run('WP CLI AS Worker');

do_action('as_worker_iteration');
$couters['rows'] = $jobsNumber;
$couters['total'] += $jobsNumber;

Expand All @@ -79,6 +79,7 @@
} catch (\Throwable $th) {
wc_get_logger()->error($th->getMessage() . '... ' . print_r($couters, true), ['context' => 'as-worker']);
delete_transient('as-worker');
do_action('as_worker_iteration_error', $th);
break;
}
}
Expand Down

0 comments on commit 3a4ec86

Please sign in to comment.