mirror of
https://github.com/linux-do/new-api.git
synced 2025-09-17 16:06:38 +08:00
feat: update cache
This commit is contained in:
parent
65b85377c6
commit
4ef98ba7eb
@ -103,7 +103,9 @@ func GetTokenById(id int) (*Token, error) {
|
||||
var err error = nil
|
||||
err = DB.First(&token, "id = ?", id).Error
|
||||
if err != nil {
|
||||
go cacheSetToken(&token)
|
||||
if common.RedisEnabled {
|
||||
go cacheSetToken(&token)
|
||||
}
|
||||
}
|
||||
return &token, err
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user