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