Browse Source

small bug

master
jcao219 14 years ago
parent
commit
8861c25d99
  1. 2
      oyoyo/client.py

2
oyoyo/client.py

@ -51,7 +51,7 @@ class TokenBucket(object):
@property @property
def tokens(self): def tokens(self):
now = time() now = time.time()
if self._tokens < self.capacity: if self._tokens < self.capacity:
delta = self.fill_rate * (now - self.timestamp) delta = self.fill_rate * (now - self.timestamp)
self._tokens = min(self.capacity, self._tokens + delta) self._tokens = min(self.capacity, self._tokens + delta)

Loading…
Cancel
Save