feat: update cache

This commit is contained in:
CaIon 2024-04-18 20:26:38 +08:00
parent 65b85377c6
commit 4ef98ba7eb

View File

@ -103,8 +103,10 @@ func GetTokenById(id int) (*Token, error) {
var err error = nil
err = DB.First(&token, "id = ?", id).Error
if err != nil {
if common.RedisEnabled {
go cacheSetToken(&token)
}
}
return &token, err
}