1 parent 1a1c0b4 commit 90fc49aCopy full SHA for 90fc49a
1 file changed
binance/depthcache.py
@@ -199,6 +199,14 @@ def _depth_event(self, msg):
199
200
"""
201
202
+ if 'e' in msg and msg['e'] == 'error':
203
+ # close the socket
204
+ self.close()
205
+
206
+ # notify the user by returning a None value
207
+ if self._callback:
208
+ self._callback(None)
209
210
if self._last_update_id is None:
211
# Initial depth snapshot fetch not yet performed, buffer messages
212
self._depth_message_buffer.append(msg)
@@ -251,3 +259,4 @@ def close(self):
251
259
:return:
252
260
253
261
self._bm.close()
262
+ self._depth_cache = None
0 commit comments