update - 测试分布式锁
This commit is contained in:
parent
278d4d989d
commit
439a2ceac5
@ -45,7 +45,7 @@ public class CustomLockProcessInstanceInterceptor extends AbstractCommandInterce
|
||||
}
|
||||
|
||||
@Override
|
||||
public <T> T execute(CommandConfig config, Command<T> command, CommandExecutor commandExecutor) {
|
||||
public final <T> T execute(CommandConfig config, Command<T> command, CommandExecutor commandExecutor) {
|
||||
if (AbstractCommand.class.isAssignableFrom(command.getClass())) {
|
||||
AbstractCommand abstractCommand = (AbstractCommand) command;
|
||||
String token = null;
|
||||
@ -143,6 +143,10 @@ public class CustomLockProcessInstanceInterceptor extends AbstractCommandInterce
|
||||
ReturnType.INTEGER, 1, keysAndArgs);
|
||||
if (result != null && result > 0)
|
||||
return true;
|
||||
} catch (Exception e) {
|
||||
log.warn("unlock error: {}", e.getMessage(), e);
|
||||
// unlock(name, token);
|
||||
return false;
|
||||
} finally {
|
||||
RedisConnectionUtils.releaseConnection(conn, factory);
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user