Skip to content

Commit

Permalink
fix(cronservice): reduce scheduled event fail rate
Browse files Browse the repository at this point in the history
INT-572
  • Loading branch information
joerivanveen committed Oct 22, 2024
1 parent 15c2d09 commit f082fea
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/Service/WpCronService.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,11 @@ public function schedule($callback, int $timestamp, ...$args): void
update_option(Pdk::get('webhookAddActions'), $this->getActions($callback, $hook));
}

wp_schedule_single_event($timestamp, $hook, $args);
/**
* TODO: callback not processed > 5% of cases, also, using '2' as timestamp is not a good practice
* notice: using a sane timestamp results in almost 0% of callbacks executed at the moment
*/
wp_schedule_single_event(2, Pdk::get('webhookActionName') . $hook, $args);
}

/**
Expand Down

0 comments on commit f082fea

Please sign in to comment.