Software /
code /
prosody
Changeset
1026:e640df2e4e9b
prosody: Fire events during server shutdown process
author | Matthew Wild <mwild1@gmail.com> |
---|---|
date | Tue, 21 Apr 2009 22:05:21 +0100 |
parents | 1024:1bcc8ca57a7c |
children | 1027:fe2e3d3dba6a |
files | prosody |
diffstat | 1 files changed, 5 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- a/prosody Tue Apr 21 21:10:42 2009 +0100 +++ b/prosody Tue Apr 21 22:05:21 2009 +0100 @@ -160,6 +160,7 @@ -- 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 @@ 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 @@ end server.closeall(); + +eventmanager.fire_event("server-stopped");