This commit is contained in:
vn.py 2018-08-04 22:08:21 +08:00
parent 1d5d7af64b
commit db905149d6

View File

@ -199,18 +199,14 @@ class CoinbaseWebsocketApi(object):
def run(self):
"""运行"""
while self.active:
stream = self.ws.recv()
data = json.loads(stream)
self.onData(data)
#try:
#stream = self.ws.recv()
#data = json.loads(stream)
#self.onData(data)
#except:
#msg = traceback.format_exc()
#self.onError(msg)
#self.reconnect()
try:
stream = self.ws.recv()
data = json.loads(stream)
self.onData(data)
except:
msg = traceback.format_exc()
self.onError(msg)
self.reconnect()
#----------------------------------------------------------------------
def close(self):