projects
/
prosody.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
mod_console: s2s:close: Use session:close() if that exists, otherwise just destroy...
[prosody.git]
/
util
/
timer.lua
diff --git
a/util/timer.lua
b/util/timer.lua
index 8bb1c11507b6e30615adc5ea450f3a4db9df76b9..819016de66c3fb8c7952604045bb628663c3e2fc 100644
(file)
--- a/
util/timer.lua
+++ b/
util/timer.lua
@@
-1,4
+1,4
@@
--- Prosody IM
v0.3
+-- Prosody IM
-- Copyright (C) 2008-2009 Matthew Wild
-- Copyright (C) 2008-2009 Waqas Hussain
--
-- Copyright (C) 2008-2009 Matthew Wild
-- Copyright (C) 2008-2009 Waqas Hussain
--
@@
-32,18
+32,16
@@
add_task = _add_task;
ns_addtimer(function()
local current_time = get_time();
if #new_data > 0 then
ns_addtimer(function()
local current_time = get_time();
if #new_data > 0 then
- for _, d in
i
pairs(new_data) do
+ for _, d in pairs(new_data) do
t_insert(data, d);
end
new_data = {};
t_insert(data, d);
end
new_data = {};
- elseif #data == 0 then
- return;
end
for i, d in pairs(data) do
local t, func = d[1], d[2];
if t <= current_time then
end
for i, d in pairs(data) do
local t, func = d[1], d[2];
if t <= current_time then
-
t_remove(data, i)
;
+
data[i] = nil
;
local r = func();
if type(r) == "number" then _add_task(r, func); end
end
local r = func();
if type(r) == "number" then _add_task(r, func); end
end