--- a/mod_audit_status/mod_audit_status.lua Thu Feb 15 09:20:50 2024 -0800
+++ b/mod_audit_status/mod_audit_status.lua Tue Feb 20 17:11:42 2024 +0000
@@ -9,10 +9,14 @@
local store = module:open_store(nil, "keyval+");
+-- This is global, to make it available to other modules
+crashed = false; --luacheck: ignore 131/crashed
+
module:hook_global("server-started", function ()
local recorded_status = store:get();
if recorded_status and recorded_status.status == "started" then
module:audit(nil, "server-crashed", { timestamp = recorded_status.heartbeat });
+ crashed = true;
end
module:audit(nil, "server-started");
store:set_key(nil, "status", "started");