mod_log_mark/mod_log_mark.lua
author Kim Alvefur <zash@zash.se>
Thu, 21 Mar 2024 19:44:27 +0100
changeset 5876 8aec430ba205
parent 2178 7be158b3376f
permissions -rw-r--r--
mod_pastebin: Back out 040eaa3844f4 Triggered error in Lua with if set over 200 and a 200+ line line message is checked.
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
2177
d15df55f0a63 mod_log_mark: Make a global module (should only be loaded once anyways)
Kim Alvefur <zash@zash.se>
parents: 1873
diff changeset
     1
module:set_global();
d15df55f0a63 mod_log_mark: Make a global module (should only be loaded once anyways)
Kim Alvefur <zash@zash.se>
parents: 1873
diff changeset
     2
1873
02390829df1a mod_log_mark: Module that sends a line to the log once per minute
Kim Alvefur <zash@zash.se>
parents:
diff changeset
     3
local log = _G.log;
02390829df1a mod_log_mark: Module that sends a line to the log once per minute
Kim Alvefur <zash@zash.se>
parents:
diff changeset
     4
2178
7be158b3376f mod_log_mark: Try to prevent timer drift
Kim Alvefur <zash@zash.se>
parents: 2177
diff changeset
     5
module:add_timer(60-os.date("%S"), function (now)
1873
02390829df1a mod_log_mark: Module that sends a line to the log once per minute
Kim Alvefur <zash@zash.se>
parents:
diff changeset
     6
	log("info", "-- MARK --");
2178
7be158b3376f mod_log_mark: Try to prevent timer drift
Kim Alvefur <zash@zash.se>
parents: 2177
diff changeset
     7
	return 90 - ((now + 30) % 60);
1873
02390829df1a mod_log_mark: Module that sends a line to the log once per minute
Kim Alvefur <zash@zash.se>
parents:
diff changeset
     8
end);