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

Use preflight filters added in WP 5.1 #75

Closed peterwilsoncc closed 4 years ago

peterwilsoncc commented 5 years ago

Task When setting and getting Cron jobs, make use of the new WP filters: pre_schedule_event, pre_reschedule_event, pre_unschedule_event, pre_clear_scheduled_hook, pre_unschedule_hook, pre_get_scheduled_event and pre_get_ready_cron_jobs.

Background In WordPress 5.1, new filters will be added to preflight event scheduling to allow for custom Cron storage systems.

The filters were added in WordPress#32656 (see WordPress/wordpress-develop@a32ea2d35d2fcf7bccf54ff7abfad9a2b49ee360) and WordPress#45797 (see WordPress/wordpress-develop@0bc20594c78369a6778635cd58f2b90c57428d6d).

peterwilsoncc commented 5 years ago

Note: pre_next_scheduled was removed during the WordPress beta period. The logic for getting the next schedule task should now be included as part of the pre_get_scheduled_event filter.

The description of this ticket has been updated to reflect these changes.

peterwilsoncc commented 5 years ago

Notes:

HM\Cavalcade\Plugin\Job class changes:

HM\Cavalcade\Plugin\Connector changes