Skip to content

Commit

Permalink
Fix tournament active time calculation (#1166)
Browse files Browse the repository at this point in the history
Return correct active time when tournament duration collides with reset schedule.
  • Loading branch information
sesposito authored Feb 2, 2024
1 parent 5d16958 commit 7a78e47
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ The format is based on [keep a changelog](http://keepachangelog.com) and this pr
- Skip Google refund handling for deleted users.
- Fix storage engine version check regression.
- Fix JS runtime tournament records list owner ids param.
- Fix regression in tournament end active time calculation when it coincides with reset schedule.

## [3.20.0] - 2023-12-15
### Changed
Expand Down
2 changes: 1 addition & 1 deletion server/core_tournament.go
Original file line number Diff line number Diff line change
Expand Up @@ -717,7 +717,7 @@ func calculateTournamentDeadlines(startTime, endTime, duration int64, resetSched
startActiveUnix = resetSchedule.Next(time.Unix(startTime, 0).UTC()).UTC().Unix()
} else {
// check if we are landing squarely on the reset schedule
landsOnSched := resetSchedule.Next(t.Add(-1*time.Second)) == t
landsOnSched := resetSchedule.Next(t.Add(-1*time.Second)).Unix() == t.Unix()
if landsOnSched {
startActiveUnix = tUnix
} else {
Expand Down

0 comments on commit 7a78e47

Please sign in to comment.