diff options
author | Matthew Wild <mwild1@gmail.com> | 2012-01-22 22:55:49 +0000 |
---|---|---|
committer | Matthew Wild <mwild1@gmail.com> | 2012-01-22 22:55:49 +0000 |
commit | 31c2d43e55f9cee309d9feeaca3ff53ceb66ceef (patch) | |
tree | acc1b9c5576f0ba21b56fd5b133a4a173798d042 /util/throttle.lua | |
parent | 76628c7453e56d5e156214c142ca05f9908c0191 (diff) | |
parent | 8292f713bab8e71624f03111115bd3a97cf8dae9 (diff) | |
download | prosody-31c2d43e55f9cee309d9feeaca3ff53ceb66ceef.tar.gz prosody-31c2d43e55f9cee309d9feeaca3ff53ceb66ceef.zip |
Merge with trunk
Diffstat (limited to 'util/throttle.lua')
-rw-r--r-- | util/throttle.lua | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/util/throttle.lua b/util/throttle.lua index 8b62e797..2e901158 100644 --- a/util/throttle.lua +++ b/util/throttle.lua @@ -1,5 +1,6 @@ local gettime = require "socket".gettime; +local setmetatable = setmetatable; module "throttle" @@ -33,7 +34,7 @@ function throttle:poll(cost, split) if split then self.balance = 0; end - return false, balance, (cost-self.balance); + return false, balance, (cost-balance); end end |