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 8bfb7bb commit 803e4af
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions cache.go
Original file line number Diff line number Diff line change
Expand Up @@ -322,9 +322,8 @@ 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 {
if err := m.cacheClientRedis.Set(updateTimeKey, time.Now().Unix(), time.Hour*24).Err(); err != nil {
log.Println("Cache lock time and cache time failed err:", lockKey, isLock, err)
return
}
Expand Down

0 comments on commit 803e4af

Please sign in to comment.