def save_stock_historical_data(self, quote, stock_historical_data_array):
if len(stock_historical_data_array) > 0:
try:
collection_name = quote + self.HISTORICAL_DATA_SUFIX
self.create_historical_collection_if_not_exists(collection_name)
stock_historical_data_collection = self.db[collection_name]
stock_historical_data_collection.insert_many(stock_historical_data_array, ordered=False)
except (DuplicateKeyError, BulkWriteError) as err:
logger.error("save_stock_historical_data: %s %i %s", quote, len(stock_historical_data_array), err)
评论列表
文章目录