Skip to content

Commit

Permalink
[修改]失效时间key增加过期
Browse files Browse the repository at this point in the history
  • Loading branch information
scorpiotzh committed Sep 23, 2020
1 parent 9f1c1b7 commit 8bfb7bb
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions cache.go
Original file line number Diff line number Diff line change
Expand Up @@ -322,6 +322,7 @@ func cacheRequestByRedis(m *Middleware, redisTime time.Duration, cacheTime int32
logger.Println("The cache interface failed err:", lockKey, isLock, err)
return
}

// 更新缓存中返回结果的时间和接口执行的时间
if err := m.cacheClientRedis.Set(updateTimeKey, time.Now().Unix(), time.Hour*48).Err(); err != nil {
log.Println("Cache lock time and cache time failed err:", lockKey, isLock, err)
Expand Down

0 comments on commit 8bfb7bb

Please sign in to comment.