Skip to content

Commit 9f1c1b7

Browse files
committed
[修改]失效时间key增加过期
1 parent fc36628 commit 9f1c1b7

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

cache.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -323,7 +323,7 @@ func cacheRequestByRedis(m *Middleware, redisTime time.Duration, cacheTime int32
323323
return
324324
}
325325
// 更新缓存中返回结果的时间和接口执行的时间
326-
if err := m.cacheClientRedis.Set(updateTimeKey, time.Now().Unix(), 0).Err(); err != nil {
326+
if err := m.cacheClientRedis.Set(updateTimeKey, time.Now().Unix(), time.Hour*48).Err(); err != nil {
327327
log.Println("Cache lock time and cache time failed err:", lockKey, isLock, err)
328328
return
329329
}

0 commit comments

Comments
 (0)