!193 enhancement #I7GMTS 本地文件监听异常会导致监听线程停止

Merge pull request !193 from Kugaaa/issues/I7GMTS
This commit is contained in:
铂赛东
2023-07-18 14:19:33 +00:00
committed by Gitee
2 changed files with 37 additions and 3 deletions

View File

@@ -63,13 +63,21 @@ public class MonitorFile {
@Override
public void onFileChange(File file) {
LOG.info("file modify,filePath={}", file.getAbsolutePath());
FlowExecutorHolder.loadInstance().reloadRule();
this.reloadRule();
}
@Override
public void onFileDelete(File file) {
LOG.info("file delete,filePath={}", file.getAbsolutePath());
FlowExecutorHolder.loadInstance().reloadRule();
this.reloadRule();
}
private void reloadRule() {
try {
FlowExecutorHolder.loadInstance().reloadRule();
} catch (Exception e) {
LOG.error("reload rule error", e);
}
}
});
// 创建文件变化监听器