Browse Source

REPORT-107976 远程设计切换目录性能优化

feature/x
roger 1 year ago
parent
commit
f482baa997
  1. 6
      designer-realize/src/main/java/com/fr/start/module/DesignerActivator.java
  2. 20
      designer-realize/src/main/java/com/fr/start/module/optimized/DesignerPluginActivator.java

6
designer-realize/src/main/java/com/fr/start/module/DesignerActivator.java

@ -188,8 +188,10 @@ public class DesignerActivator extends Activator implements Prepare {
} }
CompletableFuture<Void> themeConfigPrepare = CompletableFuture.runAsync(() -> { CompletableFuture<Void> themeConfigPrepare = CompletableFuture.runAsync(() -> {
FormThemeConfigMigrator.getInstance().upgrade(); if (WorkContext.getCurrent().isLocal()) {
ReportThemeConfigMigrator.getInstance().upgrade(); FormThemeConfigMigrator.getInstance().upgrade();
ReportThemeConfigMigrator.getInstance().upgrade();
}
}, DesignerStartupPool.common()); }, DesignerStartupPool.common());
CompletableFuture<Void> mainDesignerPrepare = CompletableFuture.runAsync(this::designerModuleStart, DesignerStartupPool.common()); CompletableFuture<Void> mainDesignerPrepare = CompletableFuture.runAsync(this::designerModuleStart, DesignerStartupPool.common());

20
designer-realize/src/main/java/com/fr/start/module/optimized/DesignerPluginActivator.java

@ -3,7 +3,11 @@ package com.fr.start.module.optimized;
import com.fr.module.Activator; import com.fr.module.Activator;
import com.fr.module.ModuleContext; import com.fr.module.ModuleContext;
import com.fr.plugin.PluginActivator; import com.fr.plugin.PluginActivator;
import com.fr.plugin.manage.PluginManager;
import com.fr.start.common.DesignerStartupExecutor; import com.fr.start.common.DesignerStartupExecutor;
import com.fr.workspace.WorkContext;
import com.fr.workspace.WorkspaceSwitchHelper;
import com.fr.workspace.WorkspaceSwitchProcess;
/** /**
* created by Harrison on 2022/06/22 * created by Harrison on 2022/06/22
@ -12,13 +16,21 @@ public class DesignerPluginActivator extends Activator {
@Override @Override
public void start() { public void start() {
WorkspaceSwitchProcess process = WorkContext.getSwitcher().getProcess();
DesignerStartupExecutor.getInstance().execute(() -> ModuleContext.getModule(PluginActivator.class).start()); if (WorkspaceSwitchHelper.supportHotSwitch(process)) {
PluginManager.getHotModule().start();
} else {
DesignerStartupExecutor.getInstance().execute(() -> ModuleContext.getModule(PluginActivator.class).start());
}
} }
@Override @Override
public void stop() { public void stop() {
WorkspaceSwitchProcess process = WorkContext.getSwitcher().getProcess();
ModuleContext.getModule(PluginActivator.class).stop(); if (WorkspaceSwitchHelper.supportHotSwitch(process)) {
PluginManager.getHotModule().stop();
} else {
ModuleContext.getModule(PluginActivator.class).stop();
}
} }
} }

Loading…
Cancel
Save