未验证 提交 34217ffe 编写于 作者: W Wenjun Ruan 提交者: GitHub

Fix view log bug (#149)

上级 bc1495f2
......@@ -94,7 +94,8 @@ public class LoggerRequestProcessor implements NettyRequestProcessor {
channel.writeAndFlush(viewLogResponse.convert2Command(command.getOpaque()));
break;
case ROLL_VIEW_LOG_REQUEST:
RollViewLogRequestCommand rollViewLogRequest = JSONUtils.parseObject(command.getBody(), RollViewLogRequestCommand.class);
RollViewLogRequestCommand rollViewLogRequest =
JSONUtils.parseObject(command.getBody(), RollViewLogRequestCommand.class);
// todo: solve the NPE, this shouldn't happen in normal case
RollViewLogResponseCommand rollViewLogRequestResponse = readPartFileContent(rollViewLogRequest);
channel.writeAndFlush(rollViewLogRequestResponse.convert2Command(command.getOpaque()));
......@@ -187,7 +188,7 @@ public class LoggerRequestProcessor implements NettyRequestProcessor {
return RollViewLogResponseCommand.error(RollViewLogResponseCommand.Status.LOG_PATH_IS_NOT_SECURITY);
}
File file = new File(rollViewLogPath);
if (!file.exists() || file.isFile()) {
if (!file.exists() || !file.isFile()) {
logger.error("Log file path: {} doesn't exists", rollViewLogPath);
return RollViewLogResponseCommand.error(RollViewLogResponseCommand.Status.LOG_FILE_NOT_FOUND);
}
......
......@@ -32,6 +32,7 @@
<node.version>v16.13.1</node.version>
<pnpm.version>v6.32.6</pnpm.version>
<sonar.sources>src</sonar.sources>
<frontend-maven-plugin.version>1.12.1</frontend-maven-plugin.version>
</properties>
<profiles>
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册