mod_cron: Fix recording last task run time #1751 0.12
authorKim Alvefur <zash@zash.se>
Thu, 05 May 2022 14:10:59 +0200
branch0.12
changeset 12493 8b42575738f0
parent 12492 3183f358a88f
child 12494 1c5cb4c49c50
child 12495 dc0c20753d6c
mod_cron: Fix recording last task run time #1751 The type checks, they do nothing! Observed: Tasks that were supposed to run weekly or daily were running each hour.
plugins/mod_cron.lua
teal-src/plugins/mod_cron.tl
--- a/plugins/mod_cron.lua	Tue May 03 19:36:17 2022 +0200
+++ b/plugins/mod_cron.lua	Thu May 05 14:10:59 2022 +0200
@@ -45,6 +45,7 @@
 local function run_task(task)
 	local started_at = os.time();
 	task:run(started_at);
+	task.last = started_at;
 	task:save(started_at);
 end
 
--- a/teal-src/plugins/mod_cron.tl	Tue May 03 19:36:17 2022 +0200
+++ b/teal-src/plugins/mod_cron.tl	Thu May 05 14:10:59 2022 +0200
@@ -84,6 +84,7 @@
 local function run_task(task : task_spec)
 	local started_at = os.time();
 	task:run(started_at);
+	task.last = started_at;
 	task:save(started_at);
 end