humanmade / Cavalcade

A better wp-cron. Horizontally scalable, works perfectly with multisite.
https://engineering.hmn.md/projects/cavalcade/
Other
512 stars 46 forks source link

#75 WP 5.1 Preflight filters. #84

Closed peterwilsoncc closed 4 years ago

peterwilsoncc commented 5 years ago

Make use of the preflight filters introduced to wp cron in WordPress 5.1

Fixes #75 Fixes #80

peterwilsoncc commented 5 years ago

@rmccue Before scheduling a single job, Core checks if an identical job is occurring within the same ten minute window; Cavalcade does not appear to do this check. Is this by design?

Note: this is still very much a WIP but I will ping you here when I have questions.

peterwilsoncc commented 5 years ago

Tests are passing, @rmccue are you able to do the review honors.

querying jobs is a little complex so you may as for changes/tests to be added there. Suggestions would be welcome.

peterwilsoncc commented 5 years ago

In their testing of the equivalent PR for Cron Control, Automattic discovered an ongoing increase in select requests (beyond the expected) so I think it's possible we'll need to make jobs caching persistent and set up the runner to work with an object cache.

See https://github.com/Automattic/Cron-Control/pull/178#issuecomment-491082513

rmccue commented 5 years ago

I believe we already have caching from #26?

peterwilsoncc commented 5 years ago

26 isn’t persistent, I’m thinking it might be worth figuring out something persistent.

Otherwise we’ll end up with a select for each wp_next_scheduled call. On sites with a large Cron table this could end up being quite a few.

-- Sent from my phone

On 11 Jun 2019, at 7:38 pm, Ryan McCue notifications@github.com wrote:

I believe we already have caching from #26?

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or mute the thread.

roborourke commented 4 years ago

Got tests passing locally with this too and code all looks good to me. I think we should get this in now but with a major version bump to 2.0.0

peterwilsoncc commented 4 years ago

Closing in favour of #91.