diff options
author | Waqas Hussain <waqas20@gmail.com> | 2012-05-12 21:46:54 +0500 |
---|---|---|
committer | Waqas Hussain <waqas20@gmail.com> | 2012-05-12 21:46:54 +0500 |
commit | 515d0ff00e9c1df1288ac577d239b8b620447c48 (patch) | |
tree | 2c1b2756fa9839aa2f689a4619cefd53eac61214 | |
parent | b11eda0f96e8501a4ffe2079a5bede95a6f091a4 (diff) | |
download | prosody-515d0ff00e9c1df1288ac577d239b8b620447c48.tar.gz prosody-515d0ff00e9c1df1288ac577d239b8b620447c48.zip |
util.timer: Always pass the current time to timer callbacks.
-rw-r--r-- | util/timer.lua | 4 |
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 |