[wp-trac] [WordPress Trac] #60645: Add pre-fire hook for cron

WordPress Trac noreply at wordpress.org
Sun May 19 06:56:41 UTC 2024


#60645: Add pre-fire hook for cron
-------------------------------------------------+-------------------------
 Reporter:  kkmuffme                             |       Owner:  audrasjb
     Type:  enhancement                          |      Status:  assigned
 Priority:  normal                               |   Milestone:  6.6
Component:  Cron API                             |     Version:
 Severity:  normal                               |  Resolution:
 Keywords:  has-patch needs-testing needs-docs   |     Focuses:
  dev-feedback                                   |
-------------------------------------------------+-------------------------

Comment (by kkmuffme):

 That will create tons of redundant code with dynamic hook names, since
 you'd have to call the same function to load it in each of them.

 Additionally, we use this hook for identification of cron hooks that do
 not have any callbacks registered. This happens a lot with plugins that
 rename their hooks in updates but forgot to unschedule the old hooks as
 well as with plugins that are deactivated/uninstalled but don't unschedule
 their hooks.
 There's no other way to do this atm.

 This matters, since every hook (even if unused) will write (update) the
 cron option, which is rather expensive to update as it requires to be
 updated atomically and have a grace period to not get major race
 conditions in a multi-server DB multi-tiered object cache set up.

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/60645#comment:9>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list