# HG changeset patch # User Matthew Wild # Date 1474221189 -3600 # Node ID dded110af017b4449d5fe9d021b8a6c2de571918 # Parent e099586f9de52b70b7c1ebf6eb89531251162086 mod_statistics/stats: Guard usage of module:get_option() so we only call it when Prosody is running diff -r e099586f9de5 -r dded110af017 mod_statistics/stats.lib.lua --- a/mod_statistics/stats.lib.lua Sat Sep 17 18:04:46 2016 +0200 +++ b/mod_statistics/stats.lib.lua Sun Sep 18 18:53:09 2016 +0100 @@ -32,8 +32,6 @@ c2s_sessions, s2s_sessions = module:shared("/*/c2s/sessions", "/*/s2s/sessions"); end -local memory_update_interval = module:get_option_number("statistics_meminfo_interval", 60); - local stats = { total_users = { get = function () return it.count(it.keys(bare_sessions)); end @@ -91,6 +89,12 @@ }; }; +local memory_update_interval = 60; +if prosody and prosody.arg then + memory_update_interval = module:get_option_number("statistics_meminfo_interval", 60); +end + + if has_pposix and pposix.meminfo then local cached_meminfo, last_cache_update;