[wp-trac] [WordPress Trac] #49693: Drop duplicate recurring cron events
WordPress Trac
noreply at wordpress.org
Sun Mar 29 22:32:18 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 aidvu):
> To protect against blowing up the table for single events, WP prevents
identical events being scheduled within ten minutes of each other. I'm
happy enough with doing something like that but the maths would be a bit
messy. It could also be difficult for plugins using custom cron storage
with the hooks added in WP 5.1
This is something I first thought of doing, but it felt more convoluted
than an explicit rule. I also think that this wouldn't fix the problem but
only hide it, which is then troublesome for debugging.
> To be clearer, I was thinking of the same event that runs periodically
but at asymmetrical intervals. To use the weather example, a news site
downloading latest forecast for my home town might use two daily events
with the hook 49693_bomau_weather_update [ [ 'product' => 'IDV10450' ] ]
running at 5:15am and 4:25pm which is when the local reports are updated.
This is what I meant by custom intervals. But then again, I can't argue
that it's not convenient to use the same event twice at different times
(but it does feel wrong to me).
----
All that said, I can implement whatever we agree on, but my vote is for a
more explicit no-duplicates rule.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/49693#comment:9>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list