humanmade / Cavalcade

A better wp-cron. Horizontally scalable, works perfectly with multisite.
https://engineering.hmn.md/projects/cavalcade/
Other
515 stars 46 forks source link

Include interval in `update_cron_array` massager's real key. #64

Closed peterwilsoncc closed 5 years ago

peterwilsoncc commented 5 years ago

Cavalcade prevents the rescheduling of an existing job to a new frequency as the change in scheduling is not recognised.

Including the interval in the connector's real key will resolve the problem.

To reproduce the error, run the following:

$stamp = time() + HOUR_IN_SECONDS;
wp_schedule_event( $stamp, 'hourly', 'cavalcade_repeat' );
wp_schedule_event( $stamp, 'twicedaily', 'cavalcade_repeat' );

var_dump( _get_cron_array()[ wp_next_scheduled( 'cavalcade_repeat' ) ] );

The final line will show the job is scheduled to run hourly.

peterwilsoncc commented 5 years ago

Fixed by #65