8000 Do not attempt to detach websocket handler if it was not attached. · pythonanywhere/tornadio2@028b4e1 · GitHub
[go: up one dir, main page]

Skip to content

Commit 028b4e1

Browse files
committed
Do not attempt to detach websocket handler if it was not attached.
1 parent 249a33c commit 028b4e1

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

tornadio2/persistent.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -74,8 +74,9 @@ def _connection_check(self):
7474

7575
def _detach(self):
7676
if self.session is not None:
77-
self.session.stop_heartbeat()
78-
self.session.remove_handler(self)
77+
if self._is_active:
78+
self.session.stop_heartbeat()
79+
self.session.remove_handler(self)
7980

8081
self.session = None
8182

0 commit comments

Comments
 (0)
0