From 914d3acbd53cc04aac4dc15b3d5efcbbde275f97 Mon Sep 17 00:00:00 2001 From: Kim Alvefur Date: Fri, 3 Dec 2021 08:57:40 +0100 Subject: mod_cron: Follow convention of imports at the top --- plugins/mod_cron.lua | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'plugins') diff --git a/plugins/mod_cron.lua b/plugins/mod_cron.lua index 8d38c227..1255687e 100644 --- a/plugins/mod_cron.lua +++ b/plugins/mod_cron.lua @@ -1,6 +1,7 @@ module:set_global(); local async = require("util.async"); +local datetime = require("util.datetime"); local periods = { hourly = 3600; daily = 86400 } @@ -20,7 +21,7 @@ function module.add_host(host_module) if task.last == nil then task.last = last_run_times:get(nil, task.id); end task.save = save_task; module:log("debug", "%s task %s added, last run %s", task.when, task.id, - task.last and require("util.datetime").datetime(task.last) or "never"); + task.last and datetime.datetime(task.last) or "never"); if task.last == nil and task.when == "daily" then local now = os.time(); task.last = now - now % 86400; -- cgit v1.2.3