mirror of
https://gitee.com/dromara/RuoYi-Vue-Plus.git
synced 2026-09-20 02:08:15 +08:00
closeLock 改为unLock
This commit is contained in:
parent
0786110414
commit
120e6ac1fc
@ -106,7 +106,7 @@ public class RedisLockManager {
|
|||||||
* 释放锁(统一释放)
|
* 释放锁(统一释放)
|
||||||
* @param lock
|
* @param lock
|
||||||
*/
|
*/
|
||||||
public void closeLock(RLock lock){
|
public void unLock(RLock lock){
|
||||||
lock.unlock();
|
lock.unlock();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -31,9 +31,12 @@ public class TestRedisLockController {
|
|||||||
try {
|
try {
|
||||||
RLock rLock = redisLockManager.getLock(key,time, TimeUnit.SECONDS);
|
RLock rLock = redisLockManager.getLock(key,time, TimeUnit.SECONDS);
|
||||||
System.out.println(LocalTime.now().toString() +"获取到锁:"+key);
|
System.out.println(LocalTime.now().toString() +"获取到锁:"+key);
|
||||||
|
Thread.sleep(3000);
|
||||||
|
redisLockManager.unLock(rLock);
|
||||||
} catch (InterruptedException e) {
|
} catch (InterruptedException e) {
|
||||||
System.out.println(e.getMessage());
|
System.out.println(e.getMessage());
|
||||||
}
|
}
|
||||||
|
|
||||||
return AjaxResult.success();
|
return AjaxResult.success();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user