Commit b78afb29 authored by 杨明橙's avatar 杨明橙

修改BTC报价请求

parent cba74429
...@@ -75,6 +75,9 @@ class CMCPrice: ...@@ -75,6 +75,9 @@ class CMCPrice:
await self.init() await self.init()
symbol_info = self.cmc_map.get(symbol) symbol_info = self.cmc_map.get(symbol)
assert symbol_info, Exception(f'Not match [{symbol}] in {self.quick_search_url}') assert symbol_info, Exception(f'Not match [{symbol}] in {self.quick_search_url}')
# 特殊处理 以"2010-07-13T00:00:00.000Z" BTC请求不到报价
if symbol == 'BTC':
symbol_info['first_historical_data'] = '2013-01-01T00:00:00.000Z'
return symbol_info return symbol_info
async def query_added_date(self, symbol): async def query_added_date(self, symbol):
...@@ -174,10 +177,10 @@ class CMCPrice: ...@@ -174,10 +177,10 @@ class CMCPrice:
try: try:
async for filtered_data in self.loop_request(symbol, start_time): async for filtered_data in self.loop_request(symbol, start_time):
await self.save_db(symbol, filtered_data) await self.save_db(symbol, filtered_data)
return await delete_cache(self.mongodb_manager, name=f'hour_price_task_{symbol}')
except Exception as e: except Exception as e:
logger.error(e) logger.error(e)
return return
return await delete_cache(self.mongodb_manager, name=f'hour_price_task_{symbol}')
async def query_last_data(self, symbol): async def query_last_data(self, symbol):
hour_price_collect = get_hour_price_collect(self.mongodb_manager) hour_price_collect = get_hour_price_collect(self.mongodb_manager)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment