Browse Source

REPORT-73318【设计器环境监测】服务器finedb有脏数据,设计器远程切换,过程很慢且没有自动监测弹窗

1-补充日志
2-修复一个问题,要执行完之后移除,不然在 UI 线程中不执行了
feature/x
Harrison 2 years ago
parent
commit
36779698eb
  1. 10
      designer-base/src/main/java/com/fr/env/detect/EnvDetectorCenter.java

10
designer-base/src/main/java/com/fr/env/detect/EnvDetectorCenter.java vendored

@ -17,6 +17,7 @@ import com.fr.event.Event;
import com.fr.event.EventDispatcher; import com.fr.event.EventDispatcher;
import com.fr.event.Listener; import com.fr.event.Listener;
import com.fr.event.Null; import com.fr.event.Null;
import com.fr.log.FineLoggerFactory;
import com.fr.stable.core.UUID; import com.fr.stable.core.UUID;
import com.fr.task.Once; import com.fr.task.Once;
import com.fr.update.delay.DelayHelper; import com.fr.update.delay.DelayHelper;
@ -46,12 +47,14 @@ public class EnvDetectorCenter {
public void on(Event event, Null param) { public void on(Event event, Null param) {
// startup 的监听,执行一次即可 // startup 的监听,执行一次即可
EventDispatcher.stopListen(this); EventDispatcher.stopListen(this);
FineLoggerFactory.getLogger().debug("startup complete, start detecting env");
stop(); stop();
} }
}; };
private final Listener<Workspace> AFTER_SWITCH_LISTENER = new Listener<Workspace>() { private final Listener<Workspace> AFTER_SWITCH_LISTENER = new Listener<Workspace>() {
@Override @Override
public void on(Event event, Workspace param) { public void on(Event event, Workspace param) {
FineLoggerFactory.getLogger().debug("switch env complete, start detecting env");
stop(); stop();
} }
}; };
@ -158,6 +161,7 @@ public class EnvDetectorCenter {
.map(DetectorUtil::convert2Notification) .map(DetectorUtil::convert2Notification)
.collect(Collectors.toList()); .collect(Collectors.toList());
if (Collections.isEmpty(notificationModels)) { if (Collections.isEmpty(notificationModels)) {
FineLoggerFactory.getLogger().debug("detector not found any exception");
return; return;
} }
@ -169,10 +173,10 @@ public class EnvDetectorCenter {
} }
NotificationDialog dialog = new NotificationDialog(properties, notificationModels); NotificationDialog dialog = new NotificationDialog(properties, notificationModels);
dialog.open(); dialog.open();
// 执行完移除
pendingActions.remove(uuid);
}); });
// 执行完移除
pendingActions.remove(uuid);
}; };

Loading…
Cancel
Save