aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--core/moduleapi.lua2
-rw-r--r--core/storagemanager.lua15
-rw-r--r--plugins/mod_s2s/mod_s2s.lua1
3 files changed, 11 insertions, 7 deletions
diff --git a/core/moduleapi.lua b/core/moduleapi.lua
index 9b773f89..d89d46fa 100644
--- a/core/moduleapi.lua
+++ b/core/moduleapi.lua
@@ -431,7 +431,7 @@ function api:measure(name, stat_type)
end
function api:measure_object_event(events_object, event_name, stat_name)
- local m = self:measure(stat_name or event_name, "duration");
+ local m = self:measure(stat_name or event_name, "times");
local function handler(handlers, _event_name, _event_data)
local finished = m();
local ret = handlers(_event_name, _event_data);
diff --git a/core/storagemanager.lua b/core/storagemanager.lua
index cadae0ed..f0450dfb 100644
--- a/core/storagemanager.lua
+++ b/core/storagemanager.lua
@@ -153,14 +153,19 @@ function open(host, store, typ)
if err == "unsupported-store" then
if typ == "map" then -- Use shim on top of keyval store
log("debug", "map storage driver unavailable, using shim on top of keyval store.");
- return create_map_shim(host, store);
+ ret, err = create_map_shim(host, store);
+ else
+ log("debug", "Storage driver %s does not support store %s (%s), falling back to null driver",
+ driver_name, store, typ or "<nil>");
+ ret, err = null_storage_driver, nil;
end
- log("debug", "Storage driver %s does not support store %s (%s), falling back to null driver",
- driver_name, store, typ or "<nil>");
- ret = null_storage_driver;
- err = nil;
end
end
+ if ret then
+ local event_data = { host = host, store_name = store, store_type = typ, store = ret };
+ prosody.hosts[host].events.fire_event("store-opened", event_data);
+ ret, err = event_data.store, event_data.store_err;
+ end
return ret, err;
end
diff --git a/plugins/mod_s2s/mod_s2s.lua b/plugins/mod_s2s/mod_s2s.lua
index 3d5eddd7..a6fdd254 100644
--- a/plugins/mod_s2s/mod_s2s.lua
+++ b/plugins/mod_s2s/mod_s2s.lua
@@ -665,7 +665,6 @@ function listener.ondisconnect(conn, err)
if s2sout.attempt_connection(session, err) then
return; -- Session lives for now
end
- hosts[session.from_host].events.fire_event("s2s-connect-failure", { session = session, err = err });
end
(session.log or log)("debug", "s2s disconnected: %s->%s (%s)", tostring(session.from_host), tostring(session.to_host), tostring(err or "connection closed"));
s2s_destroy_session(session, err);