fix
This commit is contained in:
@@ -25,8 +25,8 @@ public class CommonConstants {
|
||||
public static final int NORMAL_LOCK_TIMES = 60 * 1000;
|
||||
|
||||
public static final int AN_HOUR_SECONDS = 3600;
|
||||
|
||||
public static final int TEN_SECONDS = 10;
|
||||
//十秒
|
||||
public static final int TEN_SECONDS = 10000;
|
||||
|
||||
/**
|
||||
* 跟进任务通知缓存时间 1小时
|
||||
|
||||
@@ -321,6 +321,16 @@ public class RedisUtilPool {
|
||||
public boolean setNxExpire(final String key, final String value, final int expire) {
|
||||
String res = new Executor<String>(shardedJedisPool) {
|
||||
@Override
|
||||
/**
|
||||
* 参数定义详解,避免用错:
|
||||
* set(String key, String value, String nxxx, String expx, int time)
|
||||
* @key key
|
||||
* @value value
|
||||
* @nxxx 1.nx : not exists, 只有key 不存在时才把key value set 到redis;
|
||||
* 2.xx : is exists ,只有 key 存在是,才把key value set 到redis
|
||||
* @expx 1.ex : seconds 秒; 2.px : milliseconds 毫秒
|
||||
* 我们当前选用的是 nx,px,即key不存在时才set,且过期时间为毫秒
|
||||
*/
|
||||
String execute() {
|
||||
return jedis.set(key, value, SET_IF_NOT_EXIST, SET_WITH_EXPIRE_TIME, expire);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user