mirror of https://github.com/zulip/zulip.git
socket: Close old connections before registering new ones under the same id
(imported from commit f9b75288cbf7e2d9baa3254d57443eea5c1f3fc3)
This commit is contained in:
parent
6443a3ed78
commit
0d989a6972
|
@ -47,6 +47,10 @@ def get_connection(id):
|
|||
return connections.get(id)
|
||||
|
||||
def register_connection(id, conn):
|
||||
# Kill any old connections if they exist
|
||||
if id in connections:
|
||||
connections[id].close()
|
||||
|
||||
conn.client_id = id
|
||||
connections[conn.client_id] = conn
|
||||
|
||||
|
|
Loading…
Reference in New Issue