Browse Source

REPORT-109660 F0052拿不到数据

release/11.0
Destiny.Lin 1 year ago
parent
commit
7b97185881
  1. 12
      designer-base/src/main/java/com/fr/design/mainframe/messagecollect/StartErrorMessageCollector.java
  2. 9
      designer-base/src/main/java/com/fr/startup/ui/StartupPageWindow.java

12
designer-base/src/main/java/com/fr/design/mainframe/messagecollect/StartErrorMessageCollector.java

@ -1,5 +1,6 @@
package com.fr.design.mainframe.messagecollect; package com.fr.design.mainframe.messagecollect;
import com.fr.concurrent.NamedThreadFactory;
import com.fr.design.DesignerEnvManager; import com.fr.design.DesignerEnvManager;
import com.fr.design.mainframe.errorinfo.ErrorInfo; import com.fr.design.mainframe.errorinfo.ErrorInfo;
import com.fr.log.FineLoggerFactory; import com.fr.log.FineLoggerFactory;
@ -7,6 +8,9 @@ import com.fr.stable.StringUtils;
import com.fr.start.common.DesignerStartupContext; import com.fr.start.common.DesignerStartupContext;
import com.fr.workspace.WorkContext; import com.fr.workspace.WorkContext;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
/** /**
* *
* @author hades * @author hades
@ -17,6 +21,7 @@ public class StartErrorMessageCollector {
private static final StartErrorMessageCollector INSTANCE = new StartErrorMessageCollector(); private static final StartErrorMessageCollector INSTANCE = new StartErrorMessageCollector();
private ExecutorService executorService = Executors.newSingleThreadExecutor(new NamedThreadFactory(StartErrorMessageCollector.this.getClass()));
private String uuid; private String uuid;
private String activeKey; private String activeKey;
@ -42,6 +47,13 @@ public class StartErrorMessageCollector {
errorInfo.saveAsJSON(); errorInfo.saveAsJSON();
} }
/**
* 异步记录
*/
public void asyncRecord(String id, String msg, String detail) {
executorService.submit(() -> record(id, msg, detail));
}
public void record(String id, String msg) { public void record(String id, String msg) {
record(id, msg, StringUtils.EMPTY); record(id, msg, StringUtils.EMPTY);
} }

9
designer-base/src/main/java/com/fr/startup/ui/StartupPageWindow.java

@ -274,14 +274,9 @@ public class StartupPageWindow extends JFrame {
setEnabled(true); setEnabled(true);
}); });
FineLoggerFactory.getLogger().error(e.getMessage(), e); FineLoggerFactory.getLogger().error(e.getMessage(), e);
ExecutorService executorService = Executors.newSingleThreadExecutor(new NamedThreadFactory(StartupPageWindow.this.getClass())); StartErrorMessageCollector.getInstance().asyncRecord(DesignerErrorMessage.UNEXCEPTED_START_FAILED.getId(),
executorService.submit(() -> StartErrorMessageCollector.getInstance().record(DesignerErrorMessage.UNEXCEPTED_START_FAILED.getId(),
DesignerErrorMessage.UNEXCEPTED_START_FAILED.getMessage(), DesignerErrorMessage.UNEXCEPTED_START_FAILED.getMessage(),
e.getMessage())); e.getMessage());
if (!executorService.isShutdown()) {
executorService.shutdown();
}
} finally { } finally {
loadingPanel.hide(); loadingPanel.hide();
} }

Loading…
Cancel
Save