auto retry

This commit is contained in:
abs3nt 2024-02-19 10:26:44 -08:00
parent 1faea3fd7f
commit 2116052d5e
Signed by: abs3nt
GPG Key ID: A7BD96A8BAB04C09

View File

@ -92,7 +92,7 @@ func GetClient(conf *config.Config) (c *spotify.Client, err error) {
}),
})
authClient := auth.Client(authCtx, tok)
client := spotify.New(authClient)
client := spotify.New(authClient, spotify.WithRetry(true))
new_token, err := client.Token()
if err != nil {
return nil, err
@ -156,7 +156,7 @@ func completeAuth(w http.ResponseWriter, r *http.Request) {
slog.Error("AUTHENTICATOR", "failed to save auth", err)
}
// use the token to get an authenticated client
client := spotify.New(auth.Client(r.Context(), tok))
client := spotify.New(auth.Client(r.Context(), tok), spotify.WithRetry(true))
fmt.Fprintf(w, "Login Completed!")
ch <- client
}