From e6562bab03bb828245a4c1b2a09cfb5c6f1dd4f7 Mon Sep 17 00:00:00 2001 From: Marcus Crane Date: Sun, 4 Aug 2024 00:11:19 +1200 Subject: [PATCH] Spin down poller if tokens are invalid Signed-off-by: Marcus Crane --- jobs/spotify.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/jobs/spotify.go b/jobs/spotify.go index dcfd37c..b5fcdca 100644 --- a/jobs/spotify.go +++ b/jobs/spotify.go @@ -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) }