mod_audit_status/mod_audit_status.lua
changeset 5747 9944c6c3e914
parent 5357 14b6397cd6de
child 5844 bd0abf821cef
equal deleted inserted replaced
5746:645de410dbca 5747:9944c6c3e914
    26 	});
    26 	});
    27 	store:set_key(nil, "status", "stopped");
    27 	store:set_key(nil, "status", "stopped");
    28 end);
    28 end);
    29 
    29 
    30 if heartbeat_interval then
    30 if heartbeat_interval then
       
    31 	local async = require "util.async";
       
    32 	local heartbeat_writer = async.runner(function (timestamp)
       
    33 		store:set_key(nil, "heartbeat", timestamp);
       
    34 	end);
       
    35 
    31 	module:add_timer(0, function ()
    36 	module:add_timer(0, function ()
    32 		store:set_key(nil, "heartbeat", os.time());
    37 		heartbeat_writer:run(os.time());
    33 		return heartbeat_interval;
    38 		return heartbeat_interval;
    34 	end);
    39 	end);
    35 end
    40 end