rev:redisson自动续期问题
This commit is contained in:
@@ -201,7 +201,7 @@ public class AcsToWmsServiceImpl implements AcsToWmsService {
|
||||
String type = whereJson.getString("type");
|
||||
JSONObject result = new JSONObject();
|
||||
RLock lock = redissonClient.getLock("acs_to_wms:" + type);
|
||||
boolean tryLock = lock.tryLock(5, TimeUnit.SECONDS);
|
||||
boolean tryLock = lock.tryLock(5,20, TimeUnit.SECONDS);
|
||||
try {
|
||||
if (tryLock) {
|
||||
String device_code = whereJson.getString("device_code");
|
||||
@@ -625,8 +625,10 @@ public class AcsToWmsServiceImpl implements AcsToWmsService {
|
||||
return result;
|
||||
}
|
||||
} finally {
|
||||
if (tryLock) {
|
||||
lock.unlock();
|
||||
if (lock.isLocked() && lock.isHeldByCurrentThread()) {
|
||||
try {
|
||||
lock.unlock();
|
||||
}catch (Exception ex){}
|
||||
}
|
||||
}
|
||||
result.put("status", HttpStatus.BAD_REQUEST.value());
|
||||
|
||||
Reference in New Issue
Block a user