chore: add more tests (#3294)

This commit is contained in:
Kevin Wan
2023-05-28 19:26:45 +08:00
committed by GitHub
parent 3726851c7f
commit 28d3905731
3 changed files with 28 additions and 4 deletions

View File

@@ -214,13 +214,14 @@ func (cc CachedConn) SetCacheCtx(ctx context.Context, key string, val any) error
return cc.cache.SetCtx(ctx, key, val)
}
// SetCache sets v into cache with given key, using given expire.
// SetCacheWithExpire sets v into cache with given key with given expire.
func (cc CachedConn) SetCacheWithExpire(key string, val any, expire time.Duration) error {
return cc.SetCacheWithExpireCtx(context.Background(), key, val, expire)
}
// SetCacheCtx sets v into cache with given key, using given expire.
func (cc CachedConn) SetCacheWithExpireCtx(ctx context.Context, key string, val any, expire time.Duration) error {
// SetCacheWithExpireCtx sets v into cache with given key with given expire.
func (cc CachedConn) SetCacheWithExpireCtx(ctx context.Context, key string, val any,
expire time.Duration) error {
return cc.cache.SetWithExpireCtx(ctx, key, val, expire)
}