Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
I
InterfaceAutoTest
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
TestAuto
InterfaceAutoTest
Commits
1e5c0247
Commit
1e5c0247
authored
May 06, 2021
by
taoke
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改读取redis
parent
c89758d3
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
3 deletions
+5
-3
common/db.py
+5
-3
No files found.
common/db.py
View file @
1e5c0247
import
redis
,
pymysql
,
enum
import
redis
,
pymysql
# redis类
# redis类
class
RedisBase
:
class
RedisBase
:
def
__init__
(
self
,
inum
):
def
__init__
(
self
,
inum
):
"""每一个数据库实例管理一个连接池"""
"""每一个数据库实例管理一个连接池"""
self
.
num
=
inum
self
.
num
=
inum
pool
=
redis
.
ConnectionPool
(
host
=
'10.197.236.197'
,
port
=
6379
,
db
=
0
,
password
=
'123456'
)
pool
=
redis
.
ConnectionPool
(
host
=
'10.197.236.197'
,
port
=
6379
,
db
=
self
.
num
,
password
=
'123456'
)
self
.
r
=
redis
.
Redis
(
connection_pool
=
pool
)
self
.
r
=
redis
.
Redis
(
connection_pool
=
pool
)
class
RedisString
(
RedisBase
):
class
RedisString
(
RedisBase
):
...
@@ -79,7 +79,9 @@ class MYSQL:
...
@@ -79,7 +79,9 @@ class MYSQL:
if
__name__
==
'__main__'
:
if
__name__
==
'__main__'
:
# r= RedisString(6).get('bmc:captcha:40ec9359-a0e8-42a1-b0c0-c19f199cab60')
# r= RedisString(6).get('bmc:captcha:40ec9359-a0e8-42a1-b0c0-c19f199cab60')
r
=
RedisString
(
0
)
.
get
(
'edl:sms_value:17822000010:MOBILE_REGISTER'
)
#
r = RedisString(0).get('edl:sms_value:17822000010:MOBILE_REGISTER')
# print(r)
# print(r)
# print(str(r)[-7:-1])
# print(str(r)[-7:-1])
pass
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