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

WordPress Trac noreply at wordpress.org
Fri Jul 3 13:15:46 UTC 2020


#49693: Drop duplicate recurring cron events
-------------------------------------------------+-------------------------
 Reporter:  aidvu                                |       Owner:  whyisjake
     Type:  enhancement                          |      Status:  accepted
 Priority:  normal                               |   Milestone:  5.5
Component:  Cron API                             |     Version:  5.4
 Severity:  normal                               |  Resolution:
 Keywords:  has-patch has-unit-tests needs-      |     Focuses:
  testing needs-dev-note                         |
-------------------------------------------------+-------------------------

Comment (by aidvu):

 Had a long night thought, and I think the
 [https://core.trac.wordpress.org/attachment/ticket/49693/49693-5.patch
 49693-5.patch] is the correct approach for limiting per day.

 The current limit for duplicate recurring events per day is 24
 **DAY_IN_SECONDS / HOUR_IN_SECONDS**, while for longer intervals it is
 **floor( EVENT_INTERVAL / HOUR_IN_SECONDS )**. Duplicate here means:
 **same hook, args, schedule and interval**.

 Tests cover less than day and more than day intervals (although because of
 the longer than day interval one might run for ''>150ms'').

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


More information about the wp-trac mailing list