RateLimiter: change CanAccept() to TryAccept()

This commit is contained in:
Hongchao Deng
2015-11-23 16:36:23 -08:00
parent 367f0e03dd
commit 13d152a873
6 changed files with 15 additions and 14 deletions

View File

@@ -163,7 +163,7 @@ func (q *RateLimitedTimedQueue) Try(fn ActionFunc) {
val, ok := q.queue.Head()
for ok {
// rate limit the queue checking
if !q.limiter.CanAccept() {
if !q.limiter.TryAccept() {
glog.V(10).Info("Try rate limitted...")
// Try again later
break