Diff

mod_measure_active_users/mod_measure_active_users.lua @ 5942:abd1bbe5006e draft default tip

Merge
author Trần H. Trung <xmpp:trần.h.trung@trung.fun>
date Sun, 16 Feb 2025 16:09:03 +0700
parent 5887:ca62f9984f4b
line wrap: on
line diff
--- a/mod_measure_active_users/mod_measure_active_users.lua	Tue Feb 06 18:32:01 2024 +0700
+++ b/mod_measure_active_users/mod_measure_active_users.lua	Sun Feb 16 16:09:03 2025 +0700
@@ -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);