Copy socket list in place to prevent a runtimeerror when the socket list

gets updated in the middle of notifications

Fixes https://trello.com/c/Q0bwCU9R/61-traceback-from-run-socketio-service
This commit is contained in:
Matthew Jones 2014-06-27 13:20:41 -04:00
parent dc661e6ba5
commit 92117ae460

View File

@ -76,7 +76,7 @@ def notification_handler(bind_port, server):
while True:
message = handler_socket.recv_json()
packet = dict(type='event', name=message['event'], endpoint=message['endpoint'], args=message)
for session_id, socket in server.sockets.iteritems():
for session_id, socket in list(server.sockets.iteritems()):
socket.send_packet(packet)
class Command(NoArgsCommand):