Commit 92ad9eb1 by CaIon

feat: update cache

parent dac68496
......@@ -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
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment