Merge branch 'release3.0.4' into develop
This commit is contained in:
commit
dffa55ddef
|
|
@ -243,6 +243,17 @@ public class BackupTask {
|
||||||
if (i != 0) {
|
if (i != 0) {
|
||||||
log.warn("导出MySQL数据异常");
|
log.warn("导出MySQL数据异常");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
DateTime dateTime = DateUtil.offsetDay(DateUtil.date(), -1);
|
||||||
|
List<File> files = FileUtil.loopFiles(sqlScript, file -> file.lastModified() < dateTime.getTime());
|
||||||
|
files.forEach(file -> {
|
||||||
|
boolean deleteSuccess = file.delete();
|
||||||
|
String success = deleteSuccess ? "success" : "fail";
|
||||||
|
String msg = StrFormatter.format("删除文件 {} {}", file.getName(), success);
|
||||||
|
log.info(msg);
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
log.warn("导出MySQL数据异常,原因 {}", e.getMessage(), e);
|
log.warn("导出MySQL数据异常,原因 {}", e.getMessage(), e);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue