package com.cf.imes.framework.redis.config;

import lombok.Data;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.validation.annotation.Validated;

/**
 * Cache 配置项
 *
 * @author Wanwan
 */
@ConfigurationProperties("chenfeng.cache")
@Data
@Validated
public class ChenfengCacheProperties {

    /**
     * {@link #redisScanBatchSize} 默认值
     */
    private static final Integer REDIS_SCAN_BATCH_SIZE_DEFAULT = 30;

    /**
     * redis scan 一次返回数量
     */
    private Integer redisScanBatchSize = REDIS_SCAN_BATCH_SIZE_DEFAULT;

    /**
     * 超时时间，单位：毫秒(ms)
     * 默认5分钟
     */
    private int lockTimeout = 300000;

    /**
     * 等待获取锁的时间，单位：毫秒(ms)
     * 默认0.5秒
     */
    private int lockWaitTime = 5000;
}
