mirror of
https://github.com/linux-do/new-api.git
synced 2025-09-23 02:26:36 +08:00
fix: fix redis error
This commit is contained in:
parent
70bdb8ca90
commit
4920922929
@ -89,8 +89,13 @@ func SyncTokenCache(frequency int) {
|
||||
common.SysError(fmt.Sprintf("failed to delete token %s from redis: %s", key, err.Error()))
|
||||
}
|
||||
} else {
|
||||
// 如果数据库中存在,则更新缓存
|
||||
err := cacheSetToken(token)
|
||||
// 如果数据库中存在,先检查redis
|
||||
_, err := common.RedisGet(fmt.Sprintf("token:%s", key))
|
||||
if err != nil {
|
||||
// 如果redis中不存在,则跳过
|
||||
continue
|
||||
}
|
||||
err = cacheSetToken(token)
|
||||
if err != nil {
|
||||
common.SysError(fmt.Sprintf("failed to update token %s to redis: %s", key, err.Error()))
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user