-
Notifications
You must be signed in to change notification settings - Fork 197
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Split scheduler to separate classes for easier testing #2991
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks pretty good! Congrats! =)
includes/background-jobs/class-sensei-scheduler-action-scheduler.php
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I tested now and it didn't work for me. I have 21 users and I removed the salt option from the database directly.
It ran the 2 first batches and after that, it continued infinitely. I checked and it entered the cancel_scheduled_job
, but it wasn't canceling.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM! Tested and working well!
This PR looks big, but it is a lot of testing.
Changes proposed in this Pull Request:
as_next_scheduled_action()
. I've fixed it so it properly reschedules when there is currently an actionin-progress
.Testing instructions:
With WooCommerce installed/activated...
sensei_course_enrolment_site_salt
).New Filters
sensei_background_job_actions
- Get a list of background job actions that are handled by the class.sensei_scheduler_class
- Override the default class that implementsSensei_Scheduler_Interface
.