[wp-trac] [WordPress Trac] #49693: Drop duplicate recurring cron events

WordPress Trac noreply at wordpress.org
Fri Mar 27 00:36:40 UTC 2020


#49693: Drop duplicate recurring cron events
----------------------------------------------------+---------------------
 Reporter:  aidvu                                   |       Owner:  (none)
     Type:  enhancement                             |      Status:  new
 Priority:  normal                                  |   Milestone:  5.5
Component:  Cron API                                |     Version:  trunk
 Severity:  normal                                  |  Resolution:
 Keywords:  has-patch has-unit-tests needs-testing  |     Focuses:
----------------------------------------------------+---------------------

Comment (by peterwilsoncc):

 I have a couple of concerns here

 Rather than adding new arguments I'd like to switch to an `$args` array.
 There's a couple of interactions in reported bugs that could be
 problematic with additional arguments. Refer
 https://core.trac.wordpress.org/ticket/34913 and
 https://core.trac.wordpress.org/ticket/35491#comment:13

 I'm not sure preventing multiple identically scheduled events is ideal. I
 can think of legitimate reasons for running the same hook & args
 combination twice.

 The first that comes to mind is scheduling a task to run at specific times
 of day; for example weather forecasts in my home town are released at
 scheduled but irregular times throughout the day. A large task might be
 set to run twice overnight to allow it to be split (but this is a less
 likely circumstance).

 > As far as I see there are a handful of plugin that call
 `wp_reschedule_event()`

 It's mainly intended as an internal function but the first few plugins hit
 6,000,000 active installs between them so we should account for them.

 I agree if not called correctly it is easy to blow up the cron array
 fairly quickly. WordPress does try to defend against developer mistakes
 but I'm not sure this is a circumstance in which it can be easily done
 without hindering the intent of more common use cases.

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


More information about the wp-trac mailing list