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