Example usage for org.springframework.data.redis.connection RedisConnection unwatch

List of usage examples for org.springframework.data.redis.connection RedisConnection unwatch

Introduction

In this page you can find the example usage for org.springframework.data.redis.connection RedisConnection unwatch.

Prototype

void unwatch();

Source Link

Document

Flushes all the previously #watch(byte[]...) keys.

Usage

From source file:com.zxy.commons.cache.RedisUtils.java

/**
 * Flushes all the previously {@link #watch(byte[])} keys.
 * <p>/*from  ww w.j a  v  a2  s .  co m*/
 * See http://redis.io/commands/unwatch
 */
public static void unwatch() {
    redisTemplate.execute(new RedisCallback<Void>() {
        @Override
        public Void doInRedis(RedisConnection redis) throws DataAccessException {
            redis.unwatch();
            return null;
        }
    });
}

From source file:com.zxy.commons.cache.RedisHelper.java

/**
 * Flushes all the previously {@link #watch(byte[])} keys.
 * <p>/*  w w  w  . ja va  2 s .  c o  m*/
 * See http://redis.io/commands/unwatch
 */
public void unwatch() {
    redisTemplate.execute(new RedisCallback<Void>() {
        @Override
        public Void doInRedis(RedisConnection redis) throws DataAccessException {
            redis.unwatch();
            return null;
        }
    });
}