feat: token缓存逻辑更新(实验性)

This commit is contained in:
CaIon committed 2024-01-25 20:09:06 +08:00
1 parent d238aaeaa1
commit a2873b6d67
4 files changed
+85 -20

No files matched your search

+5
View File
@@ -57,6 +57,11 @@ func RedisGet(key string) (string, error) {
return RDB.Get(ctx, key).Result()
}
func RedisGetEx(key string, expiration time.Duration) (string, error) {
ctx := context.Background()
return RDB.GetSet(ctx, key, expiration).Result()
}
func RedisDel(key string) error {
ctx := context.Background()
return RDB.Del(ctx, key).Err()