aboutsummaryrefslogtreecommitdiffstats
path: root/util/timer.lua
diff options
context:
space:
mode:
authorWaqas Hussain <waqas20@gmail.com>2012-05-12 21:46:54 +0500
committerWaqas Hussain <waqas20@gmail.com>2012-05-12 21:46:54 +0500
commit515d0ff00e9c1df1288ac577d239b8b620447c48 (patch)
tree2c1b2756fa9839aa2f689a4619cefd53eac61214 /util/timer.lua
parentb11eda0f96e8501a4ffe2079a5bede95a6f091a4 (diff)
downloadprosody-515d0ff00e9c1df1288ac577d239b8b620447c48.tar.gz
prosody-515d0ff00e9c1df1288ac577d239b8b620447c48.zip
util.timer: Always pass the current time to timer callbacks.
Diffstat (limited to 'util/timer.lua')
-rw-r--r--util/timer.lua4
1 files changed, 2 insertions, 2 deletions
diff --git a/util/timer.lua b/util/timer.lua
index e52a6917..af1e57b6 100644
--- a/util/timer.lua
+++ b/util/timer.lua
@@ -27,7 +27,7 @@ if not server.event then
if delay >= current_time then
t_insert(new_data, {delay, callback});
else
- local r = callback();
+ local r = callback(current_time);
if r and type(r) == "number" then
return _add_task(r, callback);
end
@@ -67,7 +67,7 @@ else
function _add_task(delay, callback)
local event_handle;
event_handle = event_base:addevent(nil, 0, function ()
- local ret = callback();
+ local ret = callback(get_time());
if ret then
return 0, ret;
elseif event_handle then