Explorar el Código

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

tags/24080901
刘帅 hace 1 año
padre
commit
2fe747fe38
Se han modificado 1 ficheros con 4 adiciones y 0 borrados
  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 Ver fichero

@@ -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;


Cargando…
Cancelar
Guardar