diff options
author | Matthew Wild <mwild1@gmail.com> | 2009-12-17 16:52:39 +0000 |
---|---|---|
committer | Matthew Wild <mwild1@gmail.com> | 2009-12-17 16:52:39 +0000 |
commit | d7d5b34c60d61ece453b2e0dcb858e8460423ecd (patch) | |
tree | c559448e59bf513011291dc4951f00564a5c306a | |
parent | 34e97d4a3c9545f71af8302b661b642b7b120a84 (diff) | |
download | prosody-d7d5b34c60d61ece453b2e0dcb858e8460423ecd.tar.gz prosody-d7d5b34c60d61ece453b2e0dcb858e8460423ecd.zip |
util.timer: Use luaevent's built-in method of repeating an event (fixes a weird crash)
-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 efc1812d..c52d9c68 100644 --- a/util/timer.lua +++ b/util/timer.lua @@ -55,10 +55,10 @@ if not event then else local EVENT_LEAVE = (event.core and event.core.LEAVE) or -1; function _add_task(delay, func) - event_base:addevent(nil, event.EV_TIMEOUT, function () + event_base:addevent(nil, 0, function () local ret = func(); if ret then - _add_task(ret, func); + return 0, ret; else return EVENT_LEAVE; end |