Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
E
exchange-binance
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
zhangheng
exchange-binance
Commits
8093dc38
Commit
8093dc38
authored
Apr 06, 2023
by
zhangheng
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update:"taos插入"
parent
000830f0
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
3 deletions
+3
-3
price_taos.py
+3
-3
No files found.
price_taos.py
View file @
8093dc38
...
@@ -34,7 +34,7 @@ class TDConn:
...
@@ -34,7 +34,7 @@ class TDConn:
def
TD_insert
(
cl
,
table
,
data
):
def
TD_insert
(
cl
,
table
,
data
):
"""插入数据"""
"""插入数据"""
try
:
try
:
sql
=
f
"INSERT INTO {table} VALUES {data};"
sql
=
f
"INSERT INTO {table}
(time, symbol, target, price)
VALUES {data};"
print
(
sql
)
print
(
sql
)
cl
.
execute
(
sql
)
cl
.
execute
(
sql
)
except
Exception
as
e
:
except
Exception
as
e
:
...
@@ -89,7 +89,7 @@ def get_redis_symbol():
...
@@ -89,7 +89,7 @@ def get_redis_symbol():
def
main
():
def
main
():
nums
=
4
0
nums
=
1
0
cl
=
TDConn
.
TD_client
()
cl
=
TDConn
.
TD_client
()
cl
.
select_db
(
"symbol_monitor"
)
cl
.
select_db
(
"symbol_monitor"
)
redis_client
=
RedisClientLocal
()
redis_client
=
RedisClientLocal
()
...
@@ -117,7 +117,7 @@ def main():
...
@@ -117,7 +117,7 @@ def main():
date
=
item
.
get
(
"date"
)
date
=
item
.
get
(
"date"
)
redis_client
.
con
()
.
set
(
f
"laravel_cache:symbol-last-price:{exchange}:{symbol}"
,
price
)
redis_client
.
con
()
.
set
(
f
"laravel_cache:symbol-last-price:{exchange}:{symbol}"
,
price
)
if
date
and
symbol
and
target
and
price
and
exchange
:
if
date
and
symbol
and
target
and
price
and
exchange
:
sql
+=
f
'({date}, "{symbol}", "{target}", {price}
, "{exchange}"
) '
sql
+=
f
'({date}, "{symbol}", "{target}", {price}) '
# 插入数据
# 插入数据
if
sql
!=
''
:
if
sql
!=
''
:
TDConn
.
TD_insert
(
cl
,
"price_binance"
,
sql
)
TDConn
.
TD_insert
(
cl
,
"price_binance"
,
sql
)
...
...
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