Browse Source

feat: 临时性日志解决方案判断文件是否存在

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

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

@@ -44,6 +44,10 @@ public class CommonLogTask {
@Scheduled(fixedDelay = 120000)
public void writeLog(){
//获取记录ID文件
boolean idFileExist = FileUtil.exist(LOG_RECORD_ADDRESS + LOG_ID_FILE);
if (!idFileExist){
FileUtil.newFile(LOG_RECORD_ADDRESS + LOG_ID_FILE);
}
FileReader fileReader = new FileReader(LOG_RECORD_ADDRESS + LOG_ID_FILE);
String result = fileReader.readString();
long startLogId = 0L;


Loading…
Cancel
Save