fix 解锁参数

This commit is contained in:
zlt2000
2020-05-07 11:50:36 +08:00
parent 9a8e70d573
commit a3e096b9ad
@@ -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);
} }
} }