This commit is contained in:
msincenselee 2017-06-03 20:15:13 +08:00
parent 80acffd28d
commit 2744b7d35a
3 changed files with 11 additions and 10 deletions

View File

@ -66,12 +66,13 @@ class NoUiMain(object):
# 十秒才执行一次检查 # 十秒才执行一次检查
self.g_count += 1 self.g_count += 1
if self.g_count <= 20: if self.g_count <= 30:
return return
self.g_count = 0 self.g_count = 0
dt = datetime.now() dt = datetime.now()
if dt.hour != self.last_dt.hour: if dt.hour != self.last_dt.hour:
self.last_dt = dt self.last_dt = dt
print u'noUiMain.py checkpoint:{0}'.format(dt)
self.mainEngine.writeLog( u'noUiMain.py checkpoint:{0}'.format(dt)) self.mainEngine.writeLog( u'noUiMain.py checkpoint:{0}'.format(dt))
# 定时断开 # 定时断开
@ -99,12 +100,13 @@ class NoUiMain(object):
self.mainEngine.writeLog(u'检查连接{0}异常,重新启动连接'.format(self.gateway_name)) self.mainEngine.writeLog(u'检查连接{0}异常,重新启动连接'.format(self.gateway_name))
self.mainEngine.writeLog(u'断开连接{0}'.format(self.gateway_name)) self.mainEngine.writeLog(u'断开连接{0}'.format(self.gateway_name))
self.disconnect() self.disconnect()
self.mainEngine.writeLog(u'清空数据引擎') self.connected = False
self.mainEngine.clearData() #self.mainEngine.writeLog(u'清空数据引擎')
self.mainEngine.writeLog(u'重新连接{0}'.format(self.gateway_name)) #self.mainEngine.clearData()
self.mainEngine.connect(self.gateway_name) #self.mainEngine.writeLog(u'重新连接{0}'.format(self.gateway_name))
self.connected = True #self.mainEngine.connect(self.gateway_name)
#self.connected = True
#
def Start(self): def Start(self):
"""启动""" """启动"""

View File

@ -1,10 +1,10 @@
{ {
"orderFlowClear": 10, "orderFlowClear": 10,
"percentLimit": 80, "percentLimit": 100,
"workingOrderLimit": 200, "workingOrderLimit": 200,
"tradeLimit": 20000, "tradeLimit": 20000,
"orderSizeLimit": 100, "orderSizeLimit": 100,
"lossLimit": 10000,
"active": true, "active": true,
"lossPercentLimit": 11,
"orderFlowLimit": 20000 "orderFlowLimit": 20000
} }

View File

@ -91,7 +91,6 @@ class MainEngine(object):
if gatewayName in self.gatewayDict: if gatewayName in self.gatewayDict:
gateway = self.gatewayDict[gatewayName] gateway = self.gatewayDict[gatewayName]
return gateway.checkStatus() return gateway.checkStatus()
else: else:
self.writeLog(text.GATEWAY_NOT_EXIST.format(gateway=gatewayName)) self.writeLog(text.GATEWAY_NOT_EXIST.format(gateway=gatewayName))
return False return False