auto retry
This commit is contained in:
parent
1faea3fd7f
commit
2116052d5e
@ -92,7 +92,7 @@ func GetClient(conf *config.Config) (c *spotify.Client, err error) {
|
|||||||
}),
|
}),
|
||||||
})
|
})
|
||||||
authClient := auth.Client(authCtx, tok)
|
authClient := auth.Client(authCtx, tok)
|
||||||
client := spotify.New(authClient)
|
client := spotify.New(authClient, spotify.WithRetry(true))
|
||||||
new_token, err := client.Token()
|
new_token, err := client.Token()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
@ -156,7 +156,7 @@ func completeAuth(w http.ResponseWriter, r *http.Request) {
|
|||||||
slog.Error("AUTHENTICATOR", "failed to save auth", err)
|
slog.Error("AUTHENTICATOR", "failed to save auth", err)
|
||||||
}
|
}
|
||||||
// use the token to get an authenticated client
|
// 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!")
|
fmt.Fprintf(w, "Login Completed!")
|
||||||
ch <- client
|
ch <- client
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user