aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKim Alvefur <zash@zash.se>2019-12-08 13:38:48 +0100
committerKim Alvefur <zash@zash.se>2019-12-08 13:38:48 +0100
commit655294f93e53175928cf6523b82952134e268495 (patch)
tree00e5b3483ea0306d119521d433fc8b8c5ed4c6e5
parent9589da30b6968a355552a1e8be4b7baeaa905c4a (diff)
downloadprosody-655294f93e53175928cf6523b82952134e268495.tar.gz
prosody-655294f93e53175928cf6523b82952134e268495.zip
mod_admin_telnet: Avoid using LuaSocket for timestamps
Using util.time will make it easier to move away from LuaSocket if we ever wanted to do that.
-rw-r--r--plugins/mod_admin_telnet.lua3
1 files changed, 1 insertions, 2 deletions
diff --git a/plugins/mod_admin_telnet.lua b/plugins/mod_admin_telnet.lua
index 8427f811..60f92cda 100644
--- a/plugins/mod_admin_telnet.lua
+++ b/plugins/mod_admin_telnet.lua
@@ -1265,7 +1265,6 @@ function def_env.debug:events(host, event)
end
function def_env.debug:timers()
- local socket = require "socket";
local print = self.session.print;
local add_task = require"util.timer".add_task;
local h, params = add_task.h, add_task.params;
@@ -1293,7 +1292,7 @@ function def_env.debug:timers()
if h then
local next_time = h:peek();
if next_time then
- return true, os.date("Next event at %F %T (in %%.6fs)", next_time):format(next_time - socket.gettime());
+ return true, os.date("Next event at %F %T (in %%.6fs)", next_time):format(next_time - time.now());
end
end
return true;