aboutsummaryrefslogtreecommitdiffstats
path: root/teal-src
diff options
context:
space:
mode:
Diffstat (limited to 'teal-src')
-rw-r--r--teal-src/plugins/mod_cron.tl5
1 files changed, 5 insertions, 0 deletions
diff --git a/teal-src/plugins/mod_cron.tl b/teal-src/plugins/mod_cron.tl
index fc9e9934..078869a9 100644
--- a/teal-src/plugins/mod_cron.tl
+++ b/teal-src/plugins/mod_cron.tl
@@ -54,6 +54,11 @@ function module.add_host(host_module : moduleapi)
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");
+ if task.last == nil and task.when == "daily" then
+ -- initialize daily tasks to run at ~midnight UTC for now
+ local now = os.time();
+ task.last = now - now % 86400;
+ end
return true;
end