Browse Source

REPORT-70888 【设计器】大屏编辑器-设计器启动时默认打开的fvs模板会报错

new-design
hades 3 years ago
parent
commit
ae11f9bba2
  1. 4
      designer-realize/src/main/java/com/fr/start/module/DesignerStartup.java
  2. 13
      designer-realize/src/main/java/com/fr/start/module/optimized/TenantDBAdapter4Designer.java

4
designer-realize/src/main/java/com/fr/start/module/DesignerStartup.java

@ -124,6 +124,10 @@ public class DesignerStartup extends Activator {
listenEvent(LazyStartupEvent.INSTANCE, new Listener<Null>(Integer.MIN_VALUE) { listenEvent(LazyStartupEvent.INSTANCE, new Listener<Null>(Integer.MIN_VALUE) {
@Override @Override
public void on(Event event, Null param) { public void on(Event event, Null param) {
// 有可能被插件之类的 强制启动了 判断下
if (FineEmbedServer.isRunning()) {
return;
}
startEmbeddedServer(); startEmbeddedServer();
} }
}); });

13
designer-realize/src/main/java/com/fr/start/module/optimized/TenantDBAdapter4Designer.java

@ -9,6 +9,7 @@ import com.fr.event.Null;
import com.fr.exit.ConfigToPropMigrator; import com.fr.exit.ConfigToPropMigrator;
import com.fr.stable.db.tenant.TenantDBAdapter; import com.fr.stable.db.tenant.TenantDBAdapter;
import com.fr.start.event.LazyStartupEvent; import com.fr.start.event.LazyStartupEvent;
import com.fr.start.server.EmbedServerEvent;
/** /**
* @author hades * @author hades
@ -24,7 +25,15 @@ public class TenantDBAdapter4Designer extends TenantDBAdapter {
@Override @Override
public void on(Event event, Null param) { public void on(Event event, Null param) {
TenantDBAdapter4Designer.super.start(); TenantDBAdapter4Designer.super.start();
afterStart(); }
});
listenEvent(EmbedServerEvent.BeforeStart, new Listener<Null>() {
@Override
public void on(Event event, Null param) {
if (DaoSelectorFactory.getDaoSelector().useCacheDao()) {
beforeEmbedServerStart();
}
} }
}); });
@ -33,7 +42,7 @@ public class TenantDBAdapter4Designer extends TenantDBAdapter {
} }
} }
private void afterStart() { private void beforeEmbedServerStart() {
DesignerEnvManager.getEnvManager().setPropertiesUsable(false); DesignerEnvManager.getEnvManager().setPropertiesUsable(false);
DaoSwitcher.executeSwitch(); DaoSwitcher.executeSwitch();
ConfigToPropMigrator.getInstance().deletePropertiesCache(); ConfigToPropMigrator.getInstance().deletePropertiesCache();

Loading…
Cancel
Save