Skip to content
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

use Last() implementation when calculating tournament deadlines #1084

Merged
merged 14 commits into from
Sep 19, 2023

Conversation

lugehorsam
Copy link
Contributor

@lugehorsam lugehorsam commented Sep 11, 2023

Ports gorhill/cronexpr#28 to our internal version of cronexpr. This gives us the Last() method which allows us to infer the start time directly from the cronexpr rather than estimating it by invoking Next() twice.

  • Fixes calculations of leaderboard and tournament times for rare cron expressions that don't execute at a fixed interval.
  • Fixes calculations of leaderboard and tournament times for future tournaments.

server/core_tournament.go Outdated Show resolved Hide resolved
@lugehorsam
Copy link
Contributor Author

I added a test for an additional case I thought of but this is still good to review.

Copy link
Member

@sesposito sesposito left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

server/core_tournament.go Outdated Show resolved Hide resolved
server/core_tournament_test.go Show resolved Hide resolved
@lugehorsam
Copy link
Contributor Author

Ready for re-review.

Copy link
Contributor

@syhpoon syhpoon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@lugehorsam
Copy link
Contributor Author

Will still need a 👍 from @sesposito if it deserves it to unblock the merge

@lugehorsam lugehorsam merged commit 81b4c7f into master Sep 19, 2023
2 checks passed
@lugehorsam lugehorsam deleted the luke/tournament-tests branch September 19, 2023 19:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants