# HG changeset patch # User Kim Alvefur # Date 1575808728 -3600 # Node ID fabe50ea39f29b2871e29195a97ef3970801d710 # Parent 03ff1e614b4d58f66c042f5e26cc99a788f6ef9c 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. diff -r 03ff1e614b4d -r fabe50ea39f2 plugins/mod_admin_telnet.lua --- a/plugins/mod_admin_telnet.lua Sat Dec 07 22:55:51 2019 +0100 +++ b/plugins/mod_admin_telnet.lua Sun Dec 08 13:38:48 2019 +0100 @@ -1265,7 +1265,6 @@ 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 @@ 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;