Browse Source

fix: 修复文件创建失败错误

master
刘帅 1 year ago
parent
commit
4453b6a19c
1 changed files with 2 additions and 2 deletions
  1. +2
    -2
      pmapi/src/main/java/com/ningdatech/pmapi/scheduler/task/CommonLogTask.java

+ 2
- 2
pmapi/src/main/java/com/ningdatech/pmapi/scheduler/task/CommonLogTask.java View File

@@ -46,7 +46,7 @@ public class CommonLogTask {
//获取记录ID文件
boolean idFileExist = FileUtil.exist(LOG_RECORD_ADDRESS + LOG_ID_FILE);
if (!idFileExist){
FileUtil.newFile(LOG_RECORD_ADDRESS + LOG_ID_FILE);
FileUtil.touch(LOG_RECORD_ADDRESS + LOG_ID_FILE);
}
FileReader fileReader = new FileReader(LOG_RECORD_ADDRESS + LOG_ID_FILE);
String result = fileReader.readString();
@@ -94,7 +94,7 @@ public class CommonLogTask {
boolean fileExist = FileUtil.exist(fileName);
if (!fileExist){
//不存在则创建当天日志文件
FileUtil.newFile(fileName);
FileUtil.touch(fileName);
}
//写入通用规则
FileWriter writer = new FileWriter(LOG_RECORD_ADDRESS + LOG_FILE);


Loading…
Cancel
Save