aboutsummaryrefslogtreecommitdiffstats
path: root/plugins/mod_cron.lua
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/mod_cron.lua')
-rw-r--r--plugins/mod_cron.lua4
1 files changed, 2 insertions, 2 deletions
diff --git a/plugins/mod_cron.lua b/plugins/mod_cron.lua
index 1255687e..e23d6815 100644
--- a/plugins/mod_cron.lua
+++ b/plugins/mod_cron.lua
@@ -22,9 +22,9 @@ function module.add_host(host_module)
task.save = save_task;
module:log("debug", "%s task %s added, last run %s", task.when, task.id,
task.last and datetime.datetime(task.last) or "never");
- if task.last == nil and task.when == "daily" then
+ if task.last == nil then
local now = os.time();
- task.last = now - now % 86400;
+ task.last = now - now % periods[task.when];
end
return true
end