Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
lichenggang
/
bom_identify
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
07caf58c
authored
Aug 27, 2021
by
陈森彬
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
单独推送品牌到redis中
parent
de3ff5d8
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
43 additions
and
0 deletions
brand_redis.py
brand_redis.py
0 → 100644
View file @
07caf58c
#!/usr/bin/env python
# -*- coding:utf-8 -*-
'''
向redis的品牌集合添加品牌
线下在1.235
线上必须在入库服务器
'''
import
sys
import
redis
ENV
=
'test'
if
sys
.
platform
in
(
'darwin'
,
'win32'
)
else
'produce'
def
get_redis_conf
():
conf
=
{
'host'
:
'192.168.1.235'
,
'port'
:
6379
,
'password'
:
"icDb29mLy2s"
,
'db'
:
0
,
}
if
ENV
==
"produce"
:
conf
[
'host'
]
=
'127.0.0.1'
return
conf
def
get_redis_conn
():
conf
=
get_redis_conf
()
pool
=
redis
.
ConnectionPool
(
**
conf
)
task_redis
=
redis
.
Redis
(
connection_pool
=
pool
)
return
task_redis
redis_pool
=
get_redis_conn
()
def
main
():
brand_list
=
[
"英飞凌"
]
for
brand_name
in
brand_list
:
redis_pool
.
sadd
(
"brand_set"
,
brand_name
)
if
__name__
==
"__main__"
:
main
()
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