diff options
author | Matthew Wild <mwild1@gmail.com> | 2011-09-22 15:48:56 +0100 |
---|---|---|
committer | Matthew Wild <mwild1@gmail.com> | 2011-09-22 15:48:56 +0100 |
commit | 62e023da82e23f87acfaf6ff704d3763376a0b3b (patch) | |
tree | 4c84d96d444623ba3811d691dc640d9cb3472e92 | |
parent | 2efbc0394560daef8accc030af4dadb6a1614828 (diff) | |
download | prosody-62e023da82e23f87acfaf6ff704d3763376a0b3b.tar.gz prosody-62e023da82e23f87acfaf6ff704d3763376a0b3b.zip |
util.timer: Fix corner case of timer not repeating if it returns <= 0
-rw-r--r-- | util/timer.lua | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/util/timer.lua b/util/timer.lua index 3061da72..642d6e36 100644 --- a/util/timer.lua +++ b/util/timer.lua @@ -32,7 +32,10 @@ if not event then if delay >= current_time then t_insert(new_data, {delay, func}); else - func(); + local r = func(); + if r and type(r) == "number" then + return _add_task(r, func); + end end end |