mirror of
https://github.com/aljazceru/bitfinex-api-py.git
synced 2025-12-22 00:04:20 +01:00
Fix resub for authenticated sockets
This commit is contained in:
@@ -44,6 +44,9 @@ class Socket():
|
|||||||
def set_authenticated(self):
|
def set_authenticated(self):
|
||||||
self.isAuthenticated = True
|
self.isAuthenticated = True
|
||||||
|
|
||||||
|
def set_unauthenticated(self):
|
||||||
|
self.isAuthenticated = False
|
||||||
|
|
||||||
def set_websocket(self, ws):
|
def set_websocket(self, ws):
|
||||||
self.ws = ws
|
self.ws = ws
|
||||||
|
|
||||||
@@ -147,6 +150,8 @@ class GenericWebsocket:
|
|||||||
retries = 0
|
retries = 0
|
||||||
except (ConnectionClosed, socket.error) as e:
|
except (ConnectionClosed, socket.error) as e:
|
||||||
self.sockets[sId].set_disconnected()
|
self.sockets[sId].set_disconnected()
|
||||||
|
if self.sockets[sId].isAuthenticated:
|
||||||
|
self.sockets[sId].set_unauthenticated()
|
||||||
self._emit('disconnected')
|
self._emit('disconnected')
|
||||||
if (not self.attempt_retry):
|
if (not self.attempt_retry):
|
||||||
return
|
return
|
||||||
|
|||||||
Reference in New Issue
Block a user