# HG changeset patch # User Matthew Wild # Date 1701260089 0 # Node ID 9944c6c3e914414374c96069d440883fdf2d70b0 # Parent 645de410dbca8cc7c6c0351099e8eb5a7a68981f mod_audit_status: Support writing heartbeat with async storage drivers diff -r 645de410dbca -r 9944c6c3e914 mod_audit_status/mod_audit_status.lua --- a/mod_audit_status/mod_audit_status.lua Wed Nov 29 11:14:21 2023 +0100 +++ b/mod_audit_status/mod_audit_status.lua Wed Nov 29 12:14:49 2023 +0000 @@ -28,8 +28,13 @@ end); if heartbeat_interval then + local async = require "util.async"; + local heartbeat_writer = async.runner(function (timestamp) + store:set_key(nil, "heartbeat", timestamp); + end); + module:add_timer(0, function () - store:set_key(nil, "heartbeat", os.time()); + heartbeat_writer:run(os.time()); return heartbeat_interval; end); end