diff options
Diffstat (limited to 'module/network/Bucket.py')
-rw-r--r-- | module/network/Bucket.py | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/module/network/Bucket.py b/module/network/Bucket.py index dc1280ede..60d8a757a 100644 --- a/module/network/Bucket.py +++ b/module/network/Bucket.py @@ -29,11 +29,12 @@ class Bucket: def setRate(self, rate): self.lock.acquire() - self.rate = rate + self.rate = int(rate) self.lock.release() def consumed(self, amount): """ return time the process have to sleep, after consumed specified amount """ + if self.rate < 0: return 0 self.lock.acquire() self.calc_tokens() |