Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
岳巧源
/
jd_data_process
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
5f433969
authored
Oct 21, 2024
by
岳巧源
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
add vc
parent
ebf724a6
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
10 deletions
vc.py
vc.py
View file @
5f433969
...
...
@@ -277,15 +277,14 @@ def insert_ext_attr_to_redis(conf: dict):
print
(
"jd_ext_attr"
,
key
,
value
)
def
delete_redis_key
(
key
:
str
,
conf
:
dict
):
redis_host
=
conf
[
"redis"
][
"host"
]
redis_port
=
conf
[
"redis"
][
"port"
]
redis_password
=
conf
[
"redis"
][
"password"
]
redis_db
=
redis
.
Redis
(
host
=
redis_host
,
port
=
redis_port
,
password
=
redis_password
)
redis_db
.
delete
(
key
)
# 此方法危险 不建议使用
# def delete_redis_key(key: str, conf: dict):
# redis_host = conf["redis"]["host"]
# redis_port = conf["redis"]["port"]
# redis_password = conf["redis"]["password"]
# redis_db = redis.Redis(host=redis_host, port=redis_port, password=redis_password)
# redis_db.delete(key)
if
__name__
==
'__main__'
:
conf
=
config_prod
delete_redis_key
(
"jd_ext_attr"
,
conf
)
insert_ext_attr_to_redis
(
conf
)
\ No newline at end of file
pass
\ No newline at end of file
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