double check for closed connections
This commit is contained in:
parent
c3548a1530
commit
1405582cc2
1 changed files with 4 additions and 1 deletions
|
@ -48,7 +48,10 @@ class Handler(WebSocketHandler):
|
||||||
def post(self, event, data):
|
def post(self, event, data):
|
||||||
message = json_dumps([event, data])
|
message = json_dumps([event, data])
|
||||||
main = IOLoop.instance()
|
main = IOLoop.instance()
|
||||||
main.add_callback(lambda: self.write_message(message))
|
if self.ws_connection is None:
|
||||||
|
self.on_close()
|
||||||
|
else:
|
||||||
|
main.add_callback(lambda: self.write_message(message))
|
||||||
|
|
||||||
def trigger_event(event, data):
|
def trigger_event(event, data):
|
||||||
if len(state.websockets):
|
if len(state.websockets):
|
||||||
|
|
Loading…
Reference in a new issue