projects
/
prosody.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
3e71637
)
util.timer: Use luaevent's built-in method of repeating an event (fixes a weird crash)
author
Matthew Wild
<mwild1@gmail.com>
Thu, 17 Dec 2009 16:52:39 +0000
(16:52 +0000)
committer
Matthew Wild
<mwild1@gmail.com>
Thu, 17 Dec 2009 16:52:39 +0000
(16:52 +0000)
util/timer.lua
patch
|
blob
|
history
diff --git
a/util/timer.lua
b/util/timer.lua
index efc1812d3126fccf01b9719967346b77a93d685e..c52d9c68bb2ff81e2d093f9d55a0e6a3baa10f47 100644
(file)
--- 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