Skip to content

Commit

Permalink
syncing won't ever run on 15m boundaries
Browse files Browse the repository at this point in the history
  • Loading branch information
Alextopher committed Dec 3, 2023
1 parent 6331c93 commit b71b00c
Showing 1 changed file with 0 additions and 9 deletions.
9 changes: 0 additions & 9 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -67,16 +67,7 @@ func main() {
// Every 15 minutes, sync the bot with the Advent of Code API
bot.Sync()

// Sleep until the next 15 minute mark
now := time.Now()
minutes := time.Duration(15 - (now.Minute() % 15))
seconds := time.Duration(60 - now.Second())
time.Sleep(minutes*time.Minute + seconds*time.Second)

ticker := time.NewTicker(15 * time.Minute)

// Start syncing every 15 minutes
bot.Sync()
for {
<-ticker.C
bot.Sync()
Expand Down

0 comments on commit b71b00c

Please sign in to comment.