aboutsummaryrefslogtreecommitdiffstats
path: root/util/timer.lua
diff options
context:
space:
mode:
authorKim Alvefur <zash@zash.se>2015-09-18 16:08:35 +0200
committerKim Alvefur <zash@zash.se>2015-09-18 16:08:35 +0200
commitd00deda2fdc2c024a6f54f5293c8194e46cb9c3b (patch)
tree1cacfd36f57195679beb65e66e15c1d4cbbd9e6e /util/timer.lua
parent195c1407b6d3eb2b4f47051eb81a9ddee889c690 (diff)
downloadprosody-d00deda2fdc2c024a6f54f5293c8194e46cb9c3b.tar.gz
prosody-d00deda2fdc2c024a6f54f5293c8194e46cb9c3b.zip
util.timer: Fix indentation
Diffstat (limited to 'util/timer.lua')
-rw-r--r--util/timer.lua12
1 files changed, 6 insertions, 6 deletions
diff --git a/util/timer.lua b/util/timer.lua
index 7ac4b616..e3158d8b 100644
--- a/util/timer.lua
+++ b/util/timer.lua
@@ -40,15 +40,15 @@ local function _on_timer(now)
if success and type(err) == "number" then
h:insert(_callback, err + now, _id); -- re-add
params[_id] = _param;
- end
end
+ end
next_time = peek;
if peek ~= nil then
return peek - now;
end
end
local function add_task(delay, callback, param)
- local current_time = get_time();
+ local current_time = get_time();
local event_time = current_time + delay;
local id = h:insert(callback, event_time);
@@ -56,13 +56,13 @@ local function add_task(delay, callback, param)
if next_time == nil or event_time < next_time then
next_time = event_time;
_add_task(next_time - current_time, _on_timer);
- end
+ end
return id;
- end
+end
local function stop(id)
params[id] = nil;
return h:remove(id);
- end
+end
local function reschedule(id, delay)
local current_time = get_time();
local event_time = current_time + delay;
@@ -70,7 +70,7 @@ local function reschedule(id, delay)
if next_time == nil or event_time < next_time then
next_time = event_time;
_add_task(next_time - current_time, _on_timer);
- end
+ end
return id;
end