diff options
author | RaNaN <Mast3rRaNaN@hotmail.de> | 2010-12-28 00:17:15 +0100 |
---|---|---|
committer | RaNaN <Mast3rRaNaN@hotmail.de> | 2010-12-28 00:17:15 +0100 |
commit | 0f91dcb371334286b43fafffc5e4f605bd184f9d (patch) | |
tree | f6c77c71136482d4cf38fe2447c6374e3ce0e4ad /module/network/Bucket.py | |
parent | api fixes (diff) | |
download | pyload-0f91dcb371334286b43fafffc5e4f605bd184f9d.tar.xz |
working speedlimit + proxy support, closed #197
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() |