[wp-trac] [WordPress Trac] #31307: cron_request filter should pass $doing_wp_cron as an argument to callbacks

WordPress Trac noreply at wordpress.org
Thu Feb 12 16:44:01 UTC 2015


#31307: cron_request filter should pass $doing_wp_cron as an argument to callbacks
-------------------------+-----------------------------
 Reporter:  ericlewis    |      Owner:
     Type:  enhancement  |     Status:  new
 Priority:  normal       |  Milestone:  Awaiting Review
Component:  Cron API     |    Version:
 Severity:  normal       |   Keywords:
  Focuses:               |
-------------------------+-----------------------------
 The request made to the cron endpoint
 [https://github.com/WordPress/WordPress/blob/4.1/wp-includes/cron.php#L291
 is filterable]. doing_wp_cron is a timestamp created when the cron is
 spawned on a request, and embedded in the request sent to the cron
 endpoint. This is used on the cron endpoint to avoid multiple processes
 looping over the same events (see #17462).

 I'm about to filter this request as I have a read-only datacenter, so I
 need to send the request to the writeable one.

 Although I can grab the $doing_wp_cron value out of the 'key' in the
 cron_request array, that seems delicate. More elegantly we could pass the
 $doing_wp_cron value as an argument to the filter.

--
Ticket URL: <https://core.trac.wordpress.org/ticket/31307>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list