[Mod]修改vnokex的断线重连逻辑
This commit is contained in:
parent
c578d4e04d
commit
98dcecb470
@ -1,15 +1,10 @@
|
||||
# encoding: UTF-8
|
||||
|
||||
'''
|
||||
OKEX的高性能异步交易API
|
||||
|
||||
Contributor:ipqhjjybj 大佳
|
||||
'''
|
||||
|
||||
from __future__ import print_function
|
||||
|
||||
import hashlib
|
||||
import json
|
||||
import traceback
|
||||
from threading import Thread
|
||||
from time import sleep
|
||||
|
||||
@ -104,10 +99,11 @@ class OkexApi(object):
|
||||
|
||||
try:
|
||||
self.ws.send(j)
|
||||
except websocket.WebSocketConnectionClosedException:
|
||||
except:
|
||||
msg = traceback.format_exc()
|
||||
self.onError(msg)
|
||||
self.reconnect()
|
||||
|
||||
|
||||
#----------------------------------------------------------------------
|
||||
def reconnect(self):
|
||||
"""重新连接"""
|
||||
|
Loading…
Reference in New Issue
Block a user