Skip to content

Commit

Permalink
lol negative secondsRemaining
Browse files Browse the repository at this point in the history
  • Loading branch information
kevinlul committed Dec 5, 2024
1 parent 2cb2086 commit 22be220
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/timer/PersistentTimer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ export class PersistentTimer {
}
// Tick every minute if more than five minutes remain. Within five minutes, tick every five seconds.
// This is due to Discord rate limits.
const secondsRemaining = Math.ceil((now.getTime() - end.getTime()) / 1000);
const secondsRemaining = Math.ceil((end.getTime() - now.getTime()) / 1000);
const tick = secondsRemaining > 300 ? 60 : this.entity.cronIntervalSeconds;
logger.verbose(`tick: ${this.entity.id} now(${iso}) secondsRemaining(${secondsRemaining}) rate(${tick})`);
if (secondsRemaining % tick === 0) {
Expand Down

0 comments on commit 22be220

Please sign in to comment.