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

@@ -197,7 +197,7 @@ func (p dockerPuller) Pull(image string, secrets []api.Secret) error {
}
func (p throttledDockerPuller) Pull(image string, secrets []api.Secret) error {
if p.limiter.CanAccept() {
if p.limiter.TryAccept() {
return p.puller.Pull(image, secrets)
}
return fmt.Errorf("pull QPS exceeded.")