diff --git a/vnpy/api/coinbase/vncoinbase.py b/vnpy/api/coinbase/vncoinbase.py index 7efad269..04b3b4d2 100644 --- a/vnpy/api/coinbase/vncoinbase.py +++ b/vnpy/api/coinbase/vncoinbase.py @@ -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):