Changeset

2174:7be158b3376f

mod_log_mark: Try to prevent timer drift
author Kim Alvefur <zash@zash.se>
date Sun, 08 May 2016 18:05:41 +0200
parents 2173:d15df55f0a63
children 2175:cc0cf6748885
files mod_log_mark/mod_log_mark.lua
diffstat 1 files changed, 2 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/mod_log_mark/mod_log_mark.lua	Sun May 08 16:57:44 2016 +0200
+++ b/mod_log_mark/mod_log_mark.lua	Sun May 08 18:05:41 2016 +0200
@@ -2,7 +2,7 @@
 
 local log = _G.log;
 
-module:add_timer(60-os.date("%S"), function ()
+module:add_timer(60-os.date("%S"), function (now)
 	log("info", "-- MARK --");
-	return 60;
+	return 90 - ((now + 30) % 60);
 end);