[Fix]解决飞鼠行情接口3点后崩溃的问题

This commit is contained in:
vn.py 2017-09-18 17:05:59 +08:00
parent 6d3b16e663
commit e92b576a8c
4 changed files with 58 additions and 64 deletions

File diff suppressed because one or more lines are too long

View File

@ -372,7 +372,7 @@ void MdApi::OnRtnDeferDeliveryQuot(CThostDeferDeliveryQuot *pQuot)
if (pQuot) if (pQuot)
{ {
task.task_data = pQuot; task.task_data = *pQuot;
} }
else else
{ {

View File

@ -301,7 +301,8 @@ class DrEngine(object):
while self.active: while self.active:
try: try:
dbName, collectionName, d = self.queue.get(block=True, timeout=1) dbName, collectionName, d = self.queue.get(block=True, timeout=1)
self.mainEngine.dbInsert(dbName, collectionName, d) flt = {'datetime': d['datetime']}
self.mainEngine.dbUpdate(dbName, collectionName, d, flt, True)
except Empty: except Empty:
pass pass

View File

@ -7,17 +7,9 @@ import traceback
# 默认设置 # 默认设置
from chinese import text from chinese import text
# 获取目录上级路径 # 获取全局配置
path = os.path.abspath(os.path.join(os.path.dirname(__file__), '..', '..', '..')) from vnpy.trader.vtGlobal import globalSetting
SETTING_FILENAME = 'VT_setting.json'
SETTING_FILENAME = os.path.join(path, SETTING_FILENAME)
# 打开配置文件,读取语言配置 # 打开配置文件,读取语言配置
try: if globalSetting['language'] == 'english':
f = file(SETTING_FILENAME) from english import text
setting = json.load(f)
if setting['language'] == 'english':
from english import text
f.close()
except:
traceback.print_exc()