fix ping race condition

This commit is contained in:
Jakob Ketterl 2019-09-27 23:28:43 +02:00
parent 76fe11741a
commit 5f703a043b

View File

@ -216,6 +216,9 @@ class WebSocketConnection(object):
def resetPing(self): def resetPing(self):
self.cancelPing() self.cancelPing()
if not self.open:
logger.debug("resetPing() while closed. passing...")
return
self.pingTimer = threading.Timer(30, self.sendPing) self.pingTimer = threading.Timer(30, self.sendPing)
self.pingTimer.start() self.pingTimer.start()