feat: update cache

This commit is contained in:
CaIon 2024-04-18 20:26:38 +08:00
parent dac6849603
commit 92ad9eb159

View File

@ -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
}