changeset 1080:3af947e2e6d4

mod_statistics/stats.lib.lua: Only fetch shared tables if running under Prosody
author Matthew Wild <mwild1@gmail.com>
date Sat, 15 Jun 2013 21:17:09 +0100
parents 87a091f88a1d
children 3e2c4f424797
files mod_statistics/stats.lib.lua
diffstat 1 files changed, 4 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/mod_statistics/stats.lib.lua	Sat Jun 15 21:02:48 2013 +0100
+++ b/mod_statistics/stats.lib.lua	Sat Jun 15 21:17:09 2013 +0100
@@ -27,8 +27,10 @@
 local get_time = require "socket".gettime;
 
 local active_sessions, active_jids = {}, {};
-local s2s_sessions = module:shared"/*/s2s/sessions";
-local c2s_sessions = module:shared"/*/c2s/sessions";
+local c2s_sessions, s2s_sessions;
+if prosody and prosody.arg then
+	c2s_sessions, s2s_sessions = module:shared("/*/c2s/sessions", "/*/s2s/sessions");
+end
 
 local stats = {
 	total_users = {