Browse Source

Pull request #8680: REPORT-70206 处理异常情况 手动删除prop设计器启动失败

Merge in DESIGN/design from ~HADES/design:feature/x to feature/x

* commit '4bccb3288537ed74cc5f21082a78c6ecffc1a003':
  REPORT-70206 删除无用import
  REPORT-70206 处理异常情况 手动删除prop设计器启动失败
feature/x
Hades 2 years ago
parent
commit
17dd9d74bb
  1. 18
      designer-realize/src/main/java/com/fr/start/module/DesignerStartup.java

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

@ -4,6 +4,7 @@ package com.fr.start.module;
import com.fr.base.OptimizeUtil;
import com.fr.concurrent.NamedThreadFactory;
import com.fr.config.dao.DaoSelectorFactory;
import com.fr.config.dao.PropertiesConstants;
import com.fr.decision.webservice.v10.encryption.EncryptionConstants;
import com.fr.design.DesignerEnvManager;
import com.fr.design.RestartHelper;
@ -157,15 +158,28 @@ public class DesignerStartup extends Activator {
if (info.getType() == DesignerWorkspaceType.Remote) {
DaoSelectorFactory.registerDaoSelector(() -> false);
} else {
String dbConfigPath = StableUtils.pathJoin(WorkspaceUtils.getWorkspaceInfo().getPath(), ProjectConstants.CONFIG_DIRECTORY,
String webInfPath = WorkspaceUtils.getWorkspaceInfo().getPath();
String dbConfigPath = StableUtils.pathJoin(webInfPath, ProjectConstants.CONFIG_DIRECTORY,
EncryptionConstants.PROPERTY_NAME);
//
String entityPath = generatePath(webInfPath, PropertiesConstants.ENTITY_PROP);
String xmlEntityPath = generatePath(webInfPath, PropertiesConstants.XML_ENTITY_PROP);
String classNamePath = generatePath(webInfPath, PropertiesConstants.CLASS_NAME_PROP);
// 校验 平台迁移文件/缓存文件
boolean existPropCache = new File(entityPath).exists() && new File(xmlEntityPath).exists() && new File(classNamePath).exists();
DaoSelectorFactory.registerDaoSelector(() -> DesignerEnvManager.getEnvManager().isPropertiesUsable()
&& OptimizeUtil.isOpen()
&& existPropCache
&& !new File(dbConfigPath).exists());
}
}
private String generatePath(String webInfPath, String name) {
return StableUtils.pathJoin(webInfPath, ProjectConstants.EMBED_DB_DIRECTORY,
ProjectConstants.PROPERTIES_CACHE_FOR_CONFIG, name);
}
@Override
public void stop() {
// void

Loading…
Cancel
Save