diff options
author | Sebastien Douheret <sebastien.douheret@iot.bzh> | 2017-11-08 10:53:39 +0100 |
---|---|---|
committer | Sebastien Douheret <sebastien.douheret@iot.bzh> | 2017-11-08 10:53:39 +0100 |
commit | 0a5ab2ca1ab89e6e667b7f9c7bdffdff036ca9b7 (patch) | |
tree | bdc803f2d02347540d221bb9fc9f8c4b6e748481 /lib/agent/webserver.go | |
parent | 02aec942b44eecd2ea9b311bb4ba2d60cce21e9a (diff) |
Unregistered events when client WS session is closed.
Diffstat (limited to 'lib/agent/webserver.go')
-rw-r--r-- | lib/agent/webserver.go | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/lib/agent/webserver.go b/lib/agent/webserver.go index d15236d..b75abd4 100644 --- a/lib/agent/webserver.go +++ b/lib/agent/webserver.go @@ -11,6 +11,7 @@ import ( "github.com/gin-contrib/static" "github.com/gin-gonic/gin" "github.com/googollee/go-socket.io" + "github.com/iotbzh/xds-agent/lib/apiv1" ) // WebServer . @@ -233,6 +234,7 @@ func (s *WebServer) socketHandler(c *gin.Context) { so.On("disconnection", func() { s.Log.Debugf("WS disconnected (WSID=%s, SID=%s)", so.Id(), sess.ID) s.sessions.UpdateIOSocket(sess.ID, nil) + s.events.UnRegister(apiv1.EVTAll, sess.ID) }) }) |