<commit_before>package org.onetwo.boot.module.redis;

import lombok.Data;
import lombok.EqualsAndHashCode;

import org.onetwo.common.utils.LangOps;
import org.springframework.boot.context.properties.ConfigurationProperties;

/**
 * @author wayshall
 * <br/>
 */
@ConfigurationProperties("jfish.redis")
@EqualsAndHashCode(callSuper=false)
@Data
public class JFishRedisProperties {

	public static final String ENABLED_KEY = "jfish.redis.enabled";
	public static final String SERIALIZER_KEY = "jfish.redis.serializer";
	public static final String ENABLED_LOCK_REGISTRY = "jfish.redis.lockRegistry.key";

	/*String hostName = "localhost";
	int port = Protocol.DEFAULT_PORT;
	int timeout = Protocol.DEFAULT_TIMEOUT;
	String password;
	boolean usePool = true;
	int dbIndex = 0;
	boolean convertPipelineAndTxResults = true;
	JedisPoolConfig pool;*/
	
	OnceTokenProperties onceToken = new OnceTokenProperties();
	LockRegistryProperties lockRegistry = new LockRegistryProperties();
	
	/*public String getHostName() {
		return hostName;
	}*/
	
	@Data
	public static class LockRegistryProperties {
		String key;
		long expireAfter = 60000;
		
		public String getKey(){
			return key;
		}
	}
	
	@Data
	public static class OnceTokenProperties {
	    private String expiredTime = "2m";
	    private String prefix = "once-token:";
	    
	    public int getExpiredInSeconds(){
	    	return (int)LangOps.timeToSeconds(expiredTime, 120);
	    }
		
	}
}<commit_msg>fix: add redis lock key prefix<commit_after>package org.onetwo.boot.module.redis;

import org.onetwo.common.utils.LangOps;
import org.springframework.boot.context.properties.ConfigurationProperties;

import lombok.Data;
import lombok.EqualsAndHashCode;

/**
 * @author wayshall
 * <br/>
 */
@ConfigurationProperties("jfish.redis")
@EqualsAndHashCode(callSuper=false)
@Data
public class JFishRedisProperties {

	public static final String ENABLED_KEY = "jfish.redis.enabled";
	public static final String SERIALIZER_KEY = "jfish.redis.serializer";
	public static final String ENABLED_LOCK_REGISTRY = "jfish.redis.lockRegistry.key";
	private static final String LOCK_PREFX_KEY = "Zifish:RedisLock:";

	/*String hostName = "localhost";
	int port = Protocol.DEFAULT_PORT;
	int timeout = Protocol.DEFAULT_TIMEOUT;
	String password;
	boolean usePool = true;
	int dbIndex = 0;
	boolean convertPipelineAndTxResults = true;
	JedisPoolConfig pool;*/
	
	OnceTokenProperties onceToken = new OnceTokenProperties();
	LockRegistryProperties lockRegistry = new LockRegistryProperties();
	
	/*public String getHostName() {
		return hostName;
	}*/
	
	@Data
	public static class LockRegistryProperties {
		String key;
		long expireAfter = 60000;
		
		public String getKey(){
			return LOCK_PREFX_KEY + key;
		}
	}
	
	@Data
	public static class OnceTokenProperties {
	    private String expiredTime = "2m";
	    private String prefix = "once-token:";
	    
	    public int getExpiredInSeconds(){
	    	return (int)LangOps.timeToSeconds(expiredTime, 120);
	    }
		
	}
}
{'fraction_non_alphanumeric': 0.09616026711185309, 'fraction_numerical': 0.00667779632721202, 'mean_word_length': 4.695817490494297, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6276454', 'n_tokens_mistral': 996, 'n_tokens_neox': 916, 'n_words': 224}