mirror of
https://git.sr.ht/~phw/scotty
synced 2025-04-16 10:09:28 +02:00
ListenBrainz: Harmonized code
This commit is contained in:
parent
bef482fd68
commit
1b5ea241b6
1 changed files with 2 additions and 3 deletions
|
@ -57,9 +57,8 @@ func NewClient(token string) Client {
|
|||
)
|
||||
client.SetRetryMaxWaitTime(time.Duration(1 * time.Minute))
|
||||
client.SetRetryAfter(func(client *resty.Client, resp *resty.Response) (time.Duration, error) {
|
||||
resetIn, err := strconv.Atoi(resp.Header().Get("X-RateLimit-Reset-In"))
|
||||
// fmt.Printf("R %v: %v, %v\n", resp.Request.URL, resetIn, err)
|
||||
return time.Duration(resetIn * int(time.Second)), err
|
||||
retryAfter, err := strconv.Atoi(resp.Header().Get("Retry-After"))
|
||||
return time.Duration(retryAfter * int(time.Second)), err
|
||||
})
|
||||
|
||||
return Client{
|
||||
|
|
Loading…
Add table
Reference in a new issue