Changeset

5887:ca62f9984f4b

mod_measure_active_users: Switch to mod_cron for scheduling
author Matthew Wild <mwild1@gmail.com>
date Tue, 12 Mar 2024 10:56:41 +0000
parents 5886:9f2816287556
children 5888:b5a110544fd4
files mod_measure_active_users/mod_measure_active_users.lua
diffstat 1 files changed, 4 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/mod_measure_active_users/mod_measure_active_users.lua	Tue Mar 12 10:41:55 2024 +0000
+++ b/mod_measure_active_users/mod_measure_active_users.lua	Tue Mar 12 10:56:41 2024 +0000
@@ -41,8 +41,10 @@
 	measure_d1(active_d1);
 	measure_d7(active_d7);
 	measure_d30(active_d30);
-
-	return 3600 + (300*math.random());
 end
 
+-- Schedule at startup
 module:add_timer(15, update_calculations);
+
+-- Recalculate hourly
+module:hourly(update_calculations);