Commit a3e3b115 authored by jichao's avatar jichao

同步汇率

parent c04fa187
......@@ -201,6 +201,7 @@ class ExrateSync(DataSync):
'date': dt.fromtimestamp(x['date'] / 1000),
'close': x['close'],
} for x in response['body']['content']]
if save_dates:
re.batch_insert(save_dates)
except Exception as e:
logger.exception(f'url[{url}] store data failed')
......
import logging
import unittest
from typing import List
import pandas as pd
from py_jftech import autowired, parse_date, to_str
......@@ -34,7 +35,12 @@ class BasicTest(unittest.TestCase):
sync.do_sync()
@autowired(names={'sync': 'exrate-sync'})
def test_navs_sync(self, sync: DataSync = None):
def test_exrate_sync(self, sync: DataSync = None):
sync.do_sync()
@autowired
def test_sync(self, syncs: List[DataSync] = None):
for sync in syncs:
sync.do_sync()
@autowired(names={'report': 'navs-report'})
......
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