Commit 99e568d6 authored by stephen.wang's avatar stephen.wang

修正benchmark bug

parent 5f50db57
......@@ -47,16 +47,17 @@ class BenchmarkAlligamReportor(RoboReportor):
response = requests.get(f'http://jdcprod.thiztech.com/api/datas/asset-value?{urlencode(params)}').json()
if not response['success']:
raise Exception(f'''request jdc alligam failed: {response['status']}''')
rb.batch_insert([{
'date': dt.fromtimestamp(x['date'] / 1000),
'module': self.module_name,
'risk': self.risk,
'nav': x['calibrateValue'],
'remarks': json.dumps({
'av': x['originValue'],
'div': x['dividend'] if 'dividend' in x else 0
}, ensure_ascii=False)
} for x in response['body']['content']])
if response['body']['content']:
rb.batch_insert([{
'date': dt.fromtimestamp(x['date'] / 1000),
'module': self.module_name,
'risk': self.risk,
'nav': x['calibrateValue'],
'remarks': json.dumps({
'av': x['originValue'],
'div': x['dividend'] if 'dividend' in x else 0
}, ensure_ascii=False)
} for x in response['body']['content']])
if response['body']['last']:
break
else:
......
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