-
Notifications
You must be signed in to change notification settings - Fork 0
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
[#897] Ending Soon Email Modifications #916
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.
Fantastic, thanks for cleaning this up! A few questions, no blockers. 🚀
} | ||
|
||
// Set threshold to be 1/3 of bid extension window. | ||
$threshold = intval( round( $extension * .3 ) ); |
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.
💥
* | ||
* @return array | ||
*/ | ||
public function get_auctions_ending_soon_emails(): array { |
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.
much cleaner, thanks for smashing this down into one function. Late Night Jasper is not one for brevity.
add_filter( | ||
'cron_schedules', // phpcs:ignore | ||
function ( array $schedules ): array { | ||
foreach ( $this->cron_intervals as $id => $props ) { | ||
// If one is already set, confirm it matches our schedule. | ||
if ( ! empty( $schedules[ $props['name'] ] ) ) { | ||
if ( MINUTE_IN_SECONDS === $schedules[ $props['name'] ] ) { | ||
if ( $props['interval'] === $schedules[ $props['name'] ] ) { |
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.
is this line what I was missing in getting the schedule added to the cron events?
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.
It looks like the method was originally set up to only add 1 schedule, and when it was updated, the logic on this line was left to compare it just for the every minute
schedule. This updates it so it compares the current schedule with the existing one. The other method was just a duplicate, but checked for a different interval value, so I just removed it.
@jaspercroome I went ahead and added the Auction Extended hook, and moved the Auctioneer Event into that class. |
Summary
This PR makes some adjustments to how Auctions Ending Soon are determined.
Issues
Testing Instructions
For some reason, I was not getting the Bid Extension return value, so I added a fallback just in case.