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

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

Introduction

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

Prototype

void bgSave();

Source Link

Document

Start background saving of db on server.

Usage

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

/**
 * Start background saving of db on server.
 * <p>/* w w  w.j  av a2s  .co  m*/
 * See http://redis.io/commands/bgsave
 */
public static void bgSave() {
    redisTemplate.execute(new RedisCallback<Void>() {
        @Override
        public Void doInRedis(RedisConnection redis) throws DataAccessException {
            redis.bgSave();
            return null;
        }
    });
}

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

/**
 * Start background saving of db on server.
 * <p>//from  w  ww.j a  va2s . c  o m
 * See http://redis.io/commands/bgsave
 */
public void bgSave() {
    redisTemplate.execute(new RedisCallback<Void>() {
        @Override
        public Void doInRedis(RedisConnection redis) throws DataAccessException {
            redis.bgSave();
            return null;
        }
    });
}