aboutsummaryrefslogtreecommitdiffstats
path: root/util/timer.lua
diff options
context:
space:
mode:
authorMatthew Wild <mwild1@gmail.com>2010-04-07 21:01:06 +0100
committerMatthew Wild <mwild1@gmail.com>2010-04-07 21:01:06 +0100
commit27459fad4ba2e40ad09552b61d695dce2f113d40 (patch)
treec3b8063b9bd334257b09213015fb422c2db35db6 /util/timer.lua
parente0b8ae73c0c3d432aafa5a94b256442e55395ad5 (diff)
parent90116b3c354d4c48b65e1fb66074e3329bbf4fe0 (diff)
downloadprosody-27459fad4ba2e40ad09552b61d695dce2f113d40.tar.gz
prosody-27459fad4ba2e40ad09552b61d695dce2f113d40.zip
Merge 0.7->trunk
Diffstat (limited to 'util/timer.lua')
-rw-r--r--util/timer.lua5
1 files changed, 3 insertions, 2 deletions
diff --git a/util/timer.lua b/util/timer.lua
index c6bd2748..fa1dd7c5 100644
--- a/util/timer.lua
+++ b/util/timer.lua
@@ -55,11 +55,12 @@ 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, 0, function ()
+ local event_handle;
+ event_handle = event_base:addevent(nil, 0, function ()
local ret = func();
if ret then
return 0, ret;
- else
+ elseif event_handle then
return EVENT_LEAVE;
end
end