fix 解锁参数
This commit is contained in:
+2
-2
@@ -36,7 +36,7 @@ public class SuperServiceImpl<M extends BaseMapper<T>, T> extends ServiceImpl<M,
|
|||||||
if (StrUtil.isEmpty(lockKey)) {
|
if (StrUtil.isEmpty(lockKey)) {
|
||||||
throw new LockException("lockKey is null");
|
throw new LockException("lockKey is null");
|
||||||
}
|
}
|
||||||
Object lock;
|
Object lock = null;
|
||||||
try {
|
try {
|
||||||
//加锁
|
//加锁
|
||||||
lock = locker.tryLock(lockKey, 10, 60, TimeUnit.SECONDS);
|
lock = locker.tryLock(lockKey, 10, 60, TimeUnit.SECONDS);
|
||||||
@@ -55,7 +55,7 @@ public class SuperServiceImpl<M extends BaseMapper<T>, T> extends ServiceImpl<M,
|
|||||||
throw new LockException("锁等待超时");
|
throw new LockException("锁等待超时");
|
||||||
}
|
}
|
||||||
} finally {
|
} finally {
|
||||||
locker.unlock(lockKey);
|
locker.unlock(lock);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user