Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
R
redis-client-sdk
Project
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
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
go
redis-client-sdk
Commits
cb66419a
Commit
cb66419a
authored
Oct 13, 2022
by
yemin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
no message
parent
286200cd
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
1 addition
and
11 deletions
+1
-11
RedisClient.go
redis/RedisClient.go
+1
-11
No files found.
redis/RedisClient.go
View file @
cb66419a
...
...
@@ -87,17 +87,7 @@ func Get(key string) []byte {
return
rByte
}
func
Set
(
k
,
v
string
)
error
{
e
:=
getDb
()
.
Set
(
k
,
v
,
0
)
.
Err
()
if
e
==
nil
{
log
.
Debug
(
fmt
.
Sprintf
(
"设置缓存成功:%s %s"
,
k
,
v
))
}
else
{
log
.
Debug
(
fmt
.
Sprintf
(
"设置缓存失败:%s %s %s"
,
k
,
v
,
e
))
}
return
e
}
func
SetNx
(
k
,
v
string
,
timeoutSecond
int
)
error
{
func
Set
(
k
,
v
string
,
timeoutSecond
int
)
error
{
e
:=
getDb
()
.
Set
(
k
,
v
,
time
.
Duration
(
timeoutSecond
)
*
time
.
Second
)
.
Err
()
if
e
==
nil
{
log
.
Debug
(
fmt
.
Sprintf
(
"设置缓存成功:%s %s"
,
k
,
v
))
...
...
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