diff options
author | Matthew Wild <mwild1@gmail.com> | 2009-04-21 22:05:21 +0100 |
---|---|---|
committer | Matthew Wild <mwild1@gmail.com> | 2009-04-21 22:05:21 +0100 |
commit | 995524ab1700f21a26c84f14e4d239f0f629a001 (patch) | |
tree | 03f61bf43bb8888f1de94ba024d6cbd5ca896a95 | |
parent | 7f18f6d4a74a1578155b42b0ff15d8e59b53b9b2 (diff) | |
download | prosody-995524ab1700f21a26c84f14e4d239f0f629a001.tar.gz prosody-995524ab1700f21a26c84f14e4d239f0f629a001.zip |
prosody: Fire events during server shutdown process
-rwxr-xr-x | prosody | 5 |
1 files changed, 5 insertions, 0 deletions
@@ -160,6 +160,7 @@ end -- Global function to initiate prosody shutdown function prosody_shutdown(reason) log("info", "Shutting down: %s", reason or "unknown reason"); + eventmanager.fire_event("server-stopping", { reason = reason }); server.setquitting(true); end @@ -198,6 +199,8 @@ while select(2, xpcall(server.loop, catch_uncaught_error)) ~= "quitting" do socket.sleep(0.2); end +eventmanager.fire_event("server-cleanup"); + -- Ok, we're quitting I know, but we -- need to do some tidying before we go :) server.setquitting(false); @@ -224,3 +227,5 @@ for hostname, host in pairs(hosts) do end server.closeall(); + +eventmanager.fire_event("server-stopped"); |