修改本地锁map对象为线程安全的map
parent
8e8b6376e6
commit
ffd51db3ff
|
@ -5,9 +5,9 @@ import aiyh.utils.excention.CustomerException;
|
||||||
import cn.hutool.core.thread.ThreadUtil;
|
import cn.hutool.core.thread.ThreadUtil;
|
||||||
import ebu7common.youhong.ai.bean.Builder;
|
import ebu7common.youhong.ai.bean.Builder;
|
||||||
|
|
||||||
import java.util.HashMap;
|
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
import java.util.Objects;
|
import java.util.Objects;
|
||||||
|
import java.util.concurrent.ConcurrentHashMap;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* <h1>分布式锁</h1>
|
* <h1>分布式锁</h1>
|
||||||
|
@ -21,7 +21,7 @@ public class LockUtils {
|
||||||
|
|
||||||
private static final LockUtilMapper mapper = Util.getMapper(LockUtilMapper.class);
|
private static final LockUtilMapper mapper = Util.getMapper(LockUtilMapper.class);
|
||||||
|
|
||||||
private static final Map<String, LockEntity> LOCK_MAP = new HashMap<>();
|
private static final Map<String, LockEntity> LOCK_MAP = new ConcurrentHashMap<>();
|
||||||
|
|
||||||
/** 默认过期时间 10s */
|
/** 默认过期时间 10s */
|
||||||
private static final Long DEFAULT_OVERDUE_TIME = 1_000 * 10L;
|
private static final Long DEFAULT_OVERDUE_TIME = 1_000 * 10L;
|
||||||
|
|
Loading…
Reference in New Issue