[Fix]Close #650
This commit is contained in:
parent
c320ce844f
commit
2c305e8496
@ -10,10 +10,12 @@ import json
|
|||||||
import csv
|
import csv
|
||||||
import os
|
import os
|
||||||
import copy
|
import copy
|
||||||
|
import traceback
|
||||||
from collections import OrderedDict
|
from collections import OrderedDict
|
||||||
from datetime import datetime, timedelta
|
from datetime import datetime, timedelta
|
||||||
from Queue import Queue, Empty
|
from Queue import Queue, Empty
|
||||||
from threading import Thread
|
from threading import Thread
|
||||||
|
from pymongo.errors import DuplicateKeyError
|
||||||
|
|
||||||
from vnpy.event import Event
|
from vnpy.event import Event
|
||||||
from vnpy.trader.vtEvent import *
|
from vnpy.trader.vtEvent import *
|
||||||
@ -241,7 +243,10 @@ class DrEngine(object):
|
|||||||
#self.mainEngine.dbUpdate(dbName, collectionName, d, flt, True)
|
#self.mainEngine.dbUpdate(dbName, collectionName, d, flt, True)
|
||||||
|
|
||||||
# 使用insert模式更新数据,可能存在时间戳重复的情况,需要用户自行清洗
|
# 使用insert模式更新数据,可能存在时间戳重复的情况,需要用户自行清洗
|
||||||
self.mainEngine.dbInsert(dbName, collectionName, d)
|
try:
|
||||||
|
self.mainEngine.dbInsert(dbName, collectionName, d)
|
||||||
|
except DuplicateKeyError:
|
||||||
|
self.writeDrLog(u'键值重复插入失败,报错信息:' %traceback.format_exc())
|
||||||
except Empty:
|
except Empty:
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user