Commit af57407b authored by Spencer Chang's avatar Spencer Chang

[fix] 优化CountDownLatch.countDown节点

parent 7366a689
......@@ -931,6 +931,7 @@ public class SysDpExecuteHistoryServiceImpl extends BaseServiceImpl<SysDpExecute
for (int i = 1; i <= length; i++) {
String undo = undos[i - 1];
if (StringUtils.isBlank(undo)) {
downLatch.countDown();
continue;
}
String formatSql = undo;
......@@ -1024,13 +1025,13 @@ public class SysDpExecuteHistoryServiceImpl extends BaseServiceImpl<SysDpExecute
public void run() {
final ReentrantLock mainLock = this.mainLock;
mainLock.lock();
final SysDpExecuteHistoryService service = subExecContext.getService();
final IRequest requestContext = subExecContext.getRequestContext();
final String sql = subExecContext.getSql();
final String ip = subExecContext.getIp();
final String execType = subExecContext.getExecType();
final Integer seq = subExecContext.getSeq();
final String sql = subExecContext.getSql();
try {
final SysDpExecuteHistoryService service = subExecContext.getService();
final IRequest requestContext = subExecContext.getRequestContext();
final String ip = subExecContext.getIp();
final String execType = subExecContext.getExecType();
ResponseData subResponseData = new ResponseData();
if (StringUtils.equals(execType, SqlConstantUtils.SQL_EXEC_INSERT)) {
subResponseData = service.insert(requestContext, ip, sql);
......@@ -1047,8 +1048,8 @@ public class SysDpExecuteHistoryServiceImpl extends BaseServiceImpl<SysDpExecute
retMsg.put(seq, e.getMessage());
logger.info("==> 执行语句[{}]出错,详细信息:[{}]", sql, e.getMessage());
} finally {
downLatch.countDown();
mainLock.unlock();
downLatch.countDown();
}
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment