Skip to content
This repository has been archived by the owner on Nov 24, 2023. It is now read-only.

Commit

Permalink
Changing background update function sequence and fixed logging output
Browse files Browse the repository at this point in the history
  • Loading branch information
dpattmann committed Dec 16, 2021
1 parent 5fe4d21 commit 2fdc646
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions internal/store/memory_store.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,13 +31,15 @@ type MemoryStore struct {

func (s *MemoryStore) BackgroundUpdate(interval int) {
for {
<-time.After(time.Minute * time.Duration(interval))

fmt.Println("Updating token")

if _, err := s.updateToken(); err != nil {
fmt.Printf("Error updating token: %v", err)
} else {
fmt.Println("Updated token successfully")
}
fmt.Println("Updated token successfully")

<-time.After(time.Minute * time.Duration(interval))
}
}

Expand Down

0 comments on commit 2fdc646

Please sign in to comment.