# HG changeset patch # User Kim Alvefur # Date 1690715020 -7200 # Node ID 9b720c38fee8df4850cffdb1ad0fbdb07c302130 # Parent e77994e889401937bf5ef5058761c77955b09d90 mod_cron: Revert bbd3ac65640d Maybe it is better to run daily and weekly tasks 'now' on the theory that people set these things up during times that are appropriate for maintenance already, so the same time next day or next week might be fine for periodic cleanup. diff -r e77994e88940 -r 9b720c38fee8 plugins/mod_cron.lua --- a/plugins/mod_cron.lua Sun Oct 08 18:21:14 2023 +0200 +++ b/plugins/mod_cron.lua Sun Jul 30 13:03:40 2023 +0200 @@ -22,10 +22,6 @@ 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 then - local now = os.time(); - task.last = now - now % periods[task.when]; - end return true end diff -r e77994e88940 -r 9b720c38fee8 teal-src/prosody/plugins/mod_cron.tl --- a/teal-src/prosody/plugins/mod_cron.tl Sun Oct 08 18:21:14 2023 +0200 +++ b/teal-src/prosody/plugins/mod_cron.tl Sun Jul 30 13:03:40 2023 +0200 @@ -56,11 +56,6 @@ 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 then - -- initialize new tasks so e.g. daily tasks run at ~midnight UTC for now - local now = os.time(); - task.last = now - now % periods[task.when]; - end return true; end