Renamed RateLimited to RateLimit

This is more consistant with other event names.
This commit is contained in:
Bruce Marriner 2016-04-28 17:43:41 -05:00
parent 098d7861a4
commit 38c51ce788
2 changed files with 3 additions and 3 deletions

View file

@ -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
} }

View file

@ -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)