Skip to content

Commit

Permalink
Make sure reset time is exactly the right second
Browse files Browse the repository at this point in the history
  • Loading branch information
BenCodez committed Sep 10, 2023
1 parent 60957be commit a010501
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,7 @@ public void scheduleGlobalCheckVoteSite(VoteSite site) {
}
if (site.isVoteDelayDaily()) {
LocalDateTime resetTime = plugin.getTimeChecker().getTime().withHour(site.getVoteDelayDailyHour())
.withMinute(0);
.withMinute(0).withSecond(0);
LocalDateTime resetTimeTomorrow = resetTime.plusHours(24);
long time = 0;
LocalDateTime now = plugin.getTimeChecker().getTime();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -277,7 +277,7 @@ public boolean canVoteSite(VoteSite voteSite) {
return now.isAfter(nextvote);
} else {
LocalDateTime resetTime = plugin.getTimeChecker().getTime().withHour(voteSite.getVoteDelayDailyHour())
.withMinute(0);
.withMinute(0).withSecond(0);
LocalDateTime resetTimeTomorrow = resetTime.plusHours(24);

if (lastVote.isBefore(resetTimeTomorrow)) {
Expand Down Expand Up @@ -1312,7 +1312,7 @@ public long voteNextDurationTime(VoteSite voteSite, long time) {
}
} else {
LocalDateTime resetTime = plugin.getTimeChecker().getTime().withHour(voteSite.getVoteDelayDailyHour())
.withMinute(0);
.withMinute(0).withSecond(0);
LocalDateTime resetTimeTomorrow = resetTime.plusHours(24);
if (lastVote.isBefore(resetTime)) {
if (now.isBefore(resetTime)) {
Expand Down

0 comments on commit a010501

Please sign in to comment.