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