[wp-trac] [WordPress Trac] #21072: CRON often returns ambiguous values

WordPress Trac noreply at wordpress.org
Tue Apr 10 02:18:58 UTC 2018


#21072: CRON often returns ambiguous values
--------------------------------------+----------------------------
 Reporter:  evansolomon               |       Owner:  peterwilsoncc
     Type:  enhancement               |      Status:  accepted
 Priority:  normal                    |   Milestone:  5.0
Component:  Cron API                  |     Version:
 Severity:  normal                    |  Resolution:
 Keywords:  has-patch has-unit-tests  |     Focuses:
--------------------------------------+----------------------------
Changes (by peterwilsoncc):

 * keywords:  has-patch => has-patch has-unit-tests


Comment:

 In [attachment:21072.diff]:

 * `wp_schedule_single_event()`, `wp_schedule_event()`,
 `wp_reschedule_event()` and `wp_unschedule_event()`: boolean outcome
 * `wp_clear_scheduled_hook()`: false if fails to unschedule one or more
 events, zero if no events need to be unscheduled, or number of events
 unscheduled. If there are events to unschedule, partial success is
 possible.
 * `wp_unschedule_hook()` : false if it fails to unschedule events, zero if
 no events need to be unscheduled, or number of events unscheduled. If
 there are events to unschedule, partial success is not possible.
 * `spawn_cron()` false if no attempt to spawn, outcome of
 `wp_remote_post()` if an attempt is made (either an array or WP_Error)
 * `wp_cron()`: false if one or more events fail to spawn, zero if no
 events require spawning, integer indicating number of events spawned if
 all successful
 * `_set_cron_array()`: boolean outcome of `update_option()`.

 Tests updated to include return values.

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


More information about the wp-trac mailing list