forked from pothtonswer/discordmuffin
Renamed RateLimited to RateLimit
This is more consistant with other event names.
This commit is contained in:
parent
098d7861a4
commit
38c51ce788
2 changed files with 3 additions and 3 deletions
|
@ -50,8 +50,8 @@ type Connect struct{}
|
||||||
// Disconnect is an empty struct for an event.
|
// Disconnect is an empty struct for an event.
|
||||||
type Disconnect struct{}
|
type Disconnect struct{}
|
||||||
|
|
||||||
// RateLimited is a struct for the RateLimited event
|
// RateLimit is a struct for the RateLimited event
|
||||||
type RateLimited struct {
|
type RateLimit struct {
|
||||||
*TooManyRequests
|
*TooManyRequests
|
||||||
URL string
|
URL string
|
||||||
}
|
}
|
||||||
|
|
|
@ -143,7 +143,7 @@ func (s *Session) request(method, urlStr, contentType string, b []byte) (respons
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
s.log(LogInformational, "Rate Limiting %s, retry in %d", urlStr, rl.RetryAfter)
|
s.log(LogInformational, "Rate Limiting %s, retry in %d", urlStr, rl.RetryAfter)
|
||||||
s.handle(RateLimited{TooManyRequests: &rl, URL: urlStr})
|
s.handle(RateLimit{TooManyRequests: &rl, URL: urlStr})
|
||||||
|
|
||||||
mu.Lock()
|
mu.Lock()
|
||||||
time.Sleep(rl.RetryAfter)
|
time.Sleep(rl.RetryAfter)
|
||||||
|
|
Loading…
Reference in a new issue