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 | 9c852dbe50ec562269b269176c06efb3a65146bd (patch) | |
tree | 2c1b2756fa9839aa2f689a4619cefd53eac61214 | |
parent | 3b95222cad391d9d66e942b0e95db75c5421fa6c (diff) | |
download | prosody-9c852dbe50ec562269b269176c06efb3a65146bd.tar.gz prosody-9c852dbe50ec562269b269176c06efb3a65146bd.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 |