diff --git a/vn.trader/vtEngine.py b/vn.trader/vtEngine.py index 45b7e709..70d24eda 100644 --- a/vn.trader/vtEngine.py +++ b/vn.trader/vtEngine.py @@ -208,7 +208,8 @@ class MainEngine(object): host, port = loadMongoSetting() try: - self.dbClient = MongoClient(host, port) + self.dbClient = MongoClient(host, port, serverSelectionTimeoutMS=3000) + self.dbClient.server_info() self.writeLog(u'MongoDB连接成功') except ConnectionFailure: self.writeLog(u'MongoDB连接失败') @@ -349,4 +350,4 @@ class DataEngine(object): self.eventEngine.register(EVENT_ORDER, self.updateOrder) - \ No newline at end of file +