[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)
{
task.task_data = pQuot;
task.task_data = *pQuot;
}
else
{

View File

@ -301,7 +301,8 @@ class DrEngine(object):
while self.active:
try:
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:
pass

View File

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