[Super Cache] Ensure cron schedule is setup whenever the config changes#28545
[Super Cache] Ensure cron schedule is setup whenever the config changes#28545
Conversation
|
Thank you for your PR! When contributing to Jetpack, we have a few suggestions that can help us test and review your patch:
This comment will be updated as you work on your PR and make changes. If you think that some of those checks are not needed for your PR, please explain why you think so. Thanks for cooperation 🤖 The e2e test report can be found here. Please note that it can take a few minutes after the e2e tests checks are complete for the report to be available. Once your PR is ready for review, check one last time that all required checks (other than "Required review") appearing at the bottom of this PR are passing or skipped. Super Cache plugin:
|
dilirity
left a comment
There was a problem hiding this comment.
![]()
Thank you for this! I remember a while back I was testing preload for a support ticket and I couldn't re-schedule a preload after deleting it with WP Crontrol or something.
This update makes things work as expected.
…he config changes (#28545) * Fix scheduling events when none already scheduled * changelog * Refactor: declarative approach over event-driven approach Co-authored-by: Mark George <[email protected]>
|
Cherry-picked into 1.9.3 via 9d599e0 |
Possibly related: https://wordpress.org/support/topic/empty-cache-directories/
When you set a preload schedule in wp-super-cache, the cron job was only being set up if one was already scheduled. If one wasn't for any reason, then it did not add one.
This PR changes the way that cronjobs are managed: Any time the settings are edited, it ensures that there is a cron if one should be there, and there isn't one if not. If the interval gets edited, then the cronjob gets destroyed (if it exists) and recreated.
Note: this will not schedule a cronjob if preload mode is not enabled. I wanted to verify with @donnchawp that's the correct / expected behaviour.
Proposed changes:
Other information:
Jetpack product discussion
n/a
Does this pull request change what data or activity we track or use?
no
Testing instructions: