# HG changeset patch # User Matthew Wild # Date 1708449102 0 # Node ID bd0abf821ceff8f598672c3ea3fd63b5fe47b8ec # Parent fba64b043c52902a43a671234ac3c030b8f73611 mod_audit_status: Expose 'crashed' flag diff -r fba64b043c52 -r bd0abf821cef mod_audit_status/mod_audit_status.lua --- 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");