Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
P
PyFund
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
陈涛
PyFund
Commits
b78afb29
Commit
b78afb29
authored
Jun 27, 2023
by
杨明橙
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改BTC报价请求
parent
cba74429
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
1 deletion
+4
-1
price.py
service/price.py
+4
-1
No files found.
service/price.py
View file @
b78afb29
...
...
@@ -75,6 +75,9 @@ class CMCPrice:
await
self
.
init
()
symbol_info
=
self
.
cmc_map
.
get
(
symbol
)
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
async
def
query_added_date
(
self
,
symbol
):
...
...
@@ -174,10 +177,10 @@ class CMCPrice:
try
:
async
for
filtered_data
in
self
.
loop_request
(
symbol
,
start_time
):
await
self
.
save_db
(
symbol
,
filtered_data
)
return
await
delete_cache
(
self
.
mongodb_manager
,
name
=
f
'hour_price_task_{symbol}'
)
except
Exception
as
e
:
logger
.
error
(
e
)
return
return
await
delete_cache
(
self
.
mongodb_manager
,
name
=
f
'hour_price_task_{symbol}'
)
async
def
query_last_data
(
self
,
symbol
):
hour_price_collect
=
get_hour_price_collect
(
self
.
mongodb_manager
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment