|
|
@ -1,7 +1,6 @@ |
|
|
|
package com.epmet.commons.tools.distributedlock; |
|
|
|
|
|
|
|
import com.epmet.commons.tools.exception.RenException; |
|
|
|
import com.epmet.commons.tools.redis.RedisKeys; |
|
|
|
import org.apache.commons.lang3.StringUtils; |
|
|
|
import org.redisson.api.RLock; |
|
|
|
import org.redisson.api.RedissonClient; |
|
|
@ -9,7 +8,6 @@ import org.springframework.beans.factory.annotation.Autowired; |
|
|
|
import org.springframework.stereotype.Component; |
|
|
|
|
|
|
|
import java.util.concurrent.TimeUnit; |
|
|
|
import java.util.concurrent.atomic.AtomicInteger; |
|
|
|
|
|
|
|
/** |
|
|
|
* @Author zxc |
|
|
@ -23,6 +21,7 @@ public class DistributedLock { |
|
|
|
|
|
|
|
/** |
|
|
|
* @Description 抢锁🔒 每个锁持有十分钟 |
|
|
|
* watchDog模式,每隔10s,自动更改持锁时间,假设宕机,持锁时间达到时,会自动释放锁 |
|
|
|
* @Param name |
|
|
|
* @author zxc |
|
|
|
* @date 2020/10/28 2:52 下午 |
|
|
|