Redis 分布式锁

v1.4.1
Parker 4 years ago
parent 37ff6866ff
commit dd09d3086b

@ -106,7 +106,11 @@ public class RedisPlugin {
// ===================== Redis 锁相关 =====================
/*
* Redis使使
* Redis使
*
* RedisLock redisLock = new RedisLock() 穿
* redisPlugin.tryLock(redisLock)
* redisPlugin.unLock(redisLock)
*
*
* 1tair线
@ -120,9 +124,8 @@ public class RedisPlugin {
* @return identifier
*/
public RedisLock tryLock(RedisLock redisLock) {
//String identifier = UUID.randomUUID().toString().replaceAll("-","");
String identifier = "aaa";
// 锁凭证
String identifier = UUID.randomUUID().toString().replaceAll("-","");
redisLock = this.tryLock(redisLock,identifier);
if(redisLock != null){
log.info("分布式锁 - 开启: 锁名称: "+redisLock.getLockName()+" 锁凭证: \""+redisLock.getIdentifier()+"\"");

Loading…
Cancel
Save