Feature #10787
closedAudit 'init' task schedulers
0%
Description
A handful of tools in our system check and create scheduled tasks on init. Because we're running Cavalcade, this means a database hit (Cavalcade's cache group is nonpersistent).
In some cases, these jobs are things that don't need to be run, or shouldn't be run, at all. The wp_schedule_event() calls should be blocked in this case.
In other cases, it's very unnecessary to check on every single page load. The primary example here is wp_schedule_delete_old_privacy_export_files(). Perhaps we could throttle it to run only once every couple of minutes, or something like that.
There are likely other instances.
Updated by Boone Gorges almost 6 years ago
I got tired of looking at these database queries (especially in the processlog, where they show up everywhere) so I started doing work on this. See the following:
https://github.com/cuny-academic-commons/cac/commit/a921af1a07b91b3e32853fce11bacfe8bde531e9
https://github.com/cuny-academic-commons/cac/commit/79cb073f7fc232262a4f873eaf305c7c75a1573a
https://github.com/cuny-academic-commons/cac/commit/ba9a62ccac8f0bfe4b2f66ab05ee04fcc04c4788
https://github.com/cuny-academic-commons/cac/commit/daf4718f88f42881542247dac24a6e72bfecc56f
Ray, have a look at my RBE throttler here https://github.com/cuny-academic-commons/cac/blob/455353ffd8b8630214c57629840ef19c415e9857/wp-content/mu-plugins/cavalcade.php#L86 and tell me if there's a less lame way to do what I'm trying to do :-D
Updated by Boone Gorges almost 6 years ago
- Status changed from New to Resolved
- Target version changed from 1.15 to 1.14.3
I've done a quick scan of other parts of the Commons. The primary offender elsewhere is Jetpack's sync module, which checks for its own scheduled tasks on init. The way that the initializer is written makes it quite difficult to unhook this part of the process selectively (to do so would also unregister Jetpack's cron schedules, for example). Since this only affects secondary sites, I'm going to call this ticket good enough and move it back into an earlier milestone.