From 38c51ce7883951848bab4e8464d5c13bf4a9aafa Mon Sep 17 00:00:00 2001 From: Bruce Marriner Date: Thu, 28 Apr 2016 17:43:41 -0500 Subject: [PATCH] Renamed RateLimited to RateLimit This is more consistant with other event names. --- events.go | 4 ++-- restapi.go | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/events.go b/events.go index 23aa6b9..23fa9be 100644 --- a/events.go +++ b/events.go @@ -50,8 +50,8 @@ type Connect struct{} // Disconnect is an empty struct for an event. type Disconnect struct{} -// RateLimited is a struct for the RateLimited event -type RateLimited struct { +// RateLimit is a struct for the RateLimited event +type RateLimit struct { *TooManyRequests URL string } diff --git a/restapi.go b/restapi.go index 10f721f..302866e 100644 --- a/restapi.go +++ b/restapi.go @@ -143,7 +143,7 @@ func (s *Session) request(method, urlStr, contentType string, b []byte) (respons return } 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() time.Sleep(rl.RetryAfter)