Skip to content

Commit

Permalink
fix import
Browse files Browse the repository at this point in the history
  • Loading branch information
DeyiXu committed May 4, 2020
1 parent 3c5bfee commit 9306739
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 5 deletions.
2 changes: 0 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,6 @@ github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORN
github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ=
github.com/kr/text v0.1.0 h1:45sCR5RtlFHMR4UwH9sdQ5TC8v0qDQCHnXt+kaKSTVE=
github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI=
github.com/nilorg/sdk v0.0.0-20190719075935-40b1f1120e1b h1:tDssaDMcSryJQdIZe1YLE/osfYDCncSLpA954ImdZoM=
github.com/nilorg/sdk v0.0.0-20190719075935-40b1f1120e1b/go.mod h1:X1swpPdqguAZaBDoEPyEWHSsJii0YQ1o+3piMv6W3JU=
github.com/nilorg/sdk v0.0.0-20200405075129-8f922eb1fa90 h1:N4HLrIBWSiJrCrmY+DLT3lx0KXES4DXVOl1MdrvAAFA=
github.com/nilorg/sdk v0.0.0-20200405075129-8f922eb1fa90/go.mod h1:X1swpPdqguAZaBDoEPyEWHSsJii0YQ1o+3piMv6W3JU=
github.com/onsi/ginkgo v1.6.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE=
Expand Down
5 changes: 2 additions & 3 deletions redis.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,11 @@ import (
"time"

"github.com/go-redis/redis/v7"
"github.com/nilorg/go-opentaobao"
)

// SetRedis 设置RedisCache
func SetRedis(redisClient *redis.Client) {
opentaobao.GetCache = func(cacheKey string) []byte {
GetCache = func(cacheKey string) []byte {
bytes, err := redisClient.Get(cacheKey).Bytes()
if err == redis.Nil {
return nil
Expand All @@ -21,7 +20,7 @@ func SetRedis(redisClient *redis.Client) {
return bytes
}

opentaobao.SetCache = func(key string, value []byte, expiration time.Duration) bool {
SetCache = func(key string, value []byte, expiration time.Duration) bool {
err := redisClient.SetNX(key, value, expiration).Err()
if err != nil {
log.Println(err)
Expand Down

0 comments on commit 9306739

Please sign in to comment.