修正文件下载完毕后启动 jar 的错误

master
linbin 2024-09-17 23:30:26 +08:00
parent 3f220825bc
commit 3a0f1c3877
1 changed files with 1 additions and 1 deletions

View File

@ -113,6 +113,7 @@ public class DownloadFileHandler implements ReadProcessor<Object>
pipeline.channelContext().setAttach(null);
return;
}
pipeline.channelContext().setAttach(null);
switch (fileDownload.getCommand())
{
case Command.UPDATE_JAR_VERSION, UPDATE_JAR_VERSION_AND_REBOOT ->
@ -120,7 +121,6 @@ public class DownloadFileHandler implements ReadProcessor<Object>
File targetFile = new File(AgentConfig.DIR_PATH, fileDownload.getRelativePath());
Files.copy(fileDownload.getDownloadTempFile().toPath(), targetFile.toPath(), StandardCopyOption.REPLACE_EXISTING);
fileDownload.getDownloadTempFile().delete();
pipeline.channelContext().setAttach(null);
pipeline.fireWrite(new LogReport().setContent(STR.format("文件:{}更新成功", fileDownload.getRelativePath())));
if (fileDownload.getCommand() == UPDATE_JAR_VERSION_AND_REBOOT)
{