// TTL returns the remaining time to live of a key, panic when an error occurs.
TTL returns the remaining time to live of a key, panic when an error occurs.
// TTL returns the remaining time to live of a key panic when an error occurs .
func (r *RedisCache) TTL(ctx context.Context, key string) time.Duration {
	ttl, err := r.client.TTL(ctx, r.realKey(key)).Result()
	if err != nil {
		panic(fmt.Errorf("redis ttl error: %w", err))
	}
	if ttl < 0 {
		return 0
	}
	return ttl
}
func ( r * RedisCache ) TTL ( ctx context . Context , key string ) time . Duration { ttl , err := r . client . TTL ( ctx , r . realKey ( key ) ) . Result ( ) if err != nil { panic ( fmt . Errorf ( " " , err ) ) } if ttl < 0 { return 0 } return ttl }
TTL returns the remaining time to live of a key, panic when an error occurs.
TTL returns the remaining time to live of a key panic when an error occurs .