[wp-trac] [WordPress Trac] #42660: Single event scheduler

WordPress Trac noreply at wordpress.org
Wed Nov 22 08:38:32 UTC 2017


#42660: Single event scheduler
-------------------------------+------------------------------
 Reporter:  skarabeq           |       Owner:
     Type:  defect (bug)       |      Status:  new
 Priority:  normal             |   Milestone:  Awaiting Review
Component:  Cron API           |     Version:  4.9
 Severity:  normal             |  Resolution:
 Keywords:  reporter-feedback  |     Focuses:
-------------------------------+------------------------------
Changes (by dd32):

 * keywords:   => reporter-feedback
 * focuses:  performance =>
 * component:  General => Cron API


Comment:

 Unfortunately, the WordPress cron api isn't guaranteed to only run once,
 code should expect that it's possible for it to happen - however it's
 extremely unlikely to happen.
 We've improved things greatly over what it used to be #17462 & #19700, I
 don't think I've heard of major complaints since then.
 Running an external cron implementation such as Cavalcade can help,
 especially when the tasks are long running.

 Given your code in the above comment, how are you running that? Is there a
 chance that the job is simply being scheduled twice?
 What do you see if you run it like so: Do you get multiple timestamps
 being passed as the first parameter?
 {{{
 wp_schedule_single_event( time(), 'single_action', array( microtime(1) )
 );
 }}}

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


More information about the wp-trac mailing list