feat: 为login和logout等优先使用redis缓存

This commit is contained in:
Leon
2025-12-23 20:48:23 +08:00
parent f524123ea6
commit 5d88289cb0
3 changed files with 46 additions and 12 deletions

View File

@@ -58,6 +58,10 @@ func (c *Client) SetBytes(ctx context.Context, key string, value []byte, ttl tim
return c.rdb.Set(ctx, key, value, ttl).Err()
}
func (c *Client) Del(ctx context.Context, key string) error {
return c.rdb.Del(ctx, key).Err()
}
func IsMiss(err error) bool {
return err == redis.Nil
}