Commit ab524cd0 authored by 吕先亚's avatar 吕先亚

ai 通用性改动,bugfix

parent 14a17718
......@@ -116,7 +116,7 @@ def sync_sp500(day):
if day:
files = list_files_sorted_by_name(Path(__file__).parent / 'resources', day)
if files:
file = files[-1]
file = files[0]
else:
return []
wb = load_workbook(filename=file, data_only=True)
......
......@@ -247,9 +247,12 @@ class EcoSync(EcoSync):
for datum in self._datum.get_datums(type=self.datum_type):
if datum.get("source") == "calculating":
logger.debug(f'start sync ticker[{datum["bloombergTicker"]}]')
start_date = self.datum_start_date(datum['id'])
datas = sync_sp500(start_date)
self.store_date(datum['id'], datas)
while True:
datas = sync_sp500(self.datum_start_date(datum['id']))
if datas:
self.store_date(datum['id'], datas)
else:
break
def store_date(self, datumid, datas: List[dict]):
save_datas = [{
......
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