Skip to content

Commit

Permalink
Spin down poller if tokens are invalid
Browse files Browse the repository at this point in the history
Signed-off-by: Marcus Crane <[email protected]>
  • Loading branch information
marcus-crane committed Aug 3, 2024
1 parent ca1df2c commit e6562ba
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions jobs/spotify.go
Original file line number Diff line number Diff line change
Expand Up @@ -100,13 +100,14 @@ func SetupSpotifyPoller(store db.Store) {
// Locally support using oauth instead of having a token (for server side)
accessToken, refreshToken, err = performOAuth2Flow(8081)
if err != nil {
panic(err)
slog.With("error", err).Error("failed to generate access tokens")
}
}

client, err := NewClient(deviceId, accessToken, refreshToken)
if err != nil {
panic(err)
slog.With("error", err).Error("failed to create spotify client")
return
}
client.Run(store)
}
Expand Down

0 comments on commit e6562ba

Please sign in to comment.