Comparison

teal-src/plugins/mod_cron.tl @ 12489:8b42575738f0 0.12

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.
author Kim Alvefur <zash@zash.se>
date Thu, 05 May 2022 14:10:59 +0200
parent 12186:7f25ac9d8f0d
child 12498:c3e47a5dd30d
comparison
equal deleted inserted replaced
12488:3183f358a88f 12489:8b42575738f0
82 end 82 end
83 83
84 local function run_task(task : task_spec) 84 local function run_task(task : task_spec)
85 local started_at = os.time(); 85 local started_at = os.time();
86 task:run(started_at); 86 task:run(started_at);
87 task.last = started_at;
87 task:save(started_at); 88 task:save(started_at);
88 end 89 end
89 90
90 local task_runner = async.runner(run_task); 91 local task_runner = async.runner(run_task);
91 module:add_timer(1, function() : integer 92 module:add_timer(1, function() : integer