diff --git a/designer-base/src/main/java/com/fr/design/env/HttpWorkspaceConnector.java b/designer-base/src/main/java/com/fr/design/env/HttpWorkspaceConnector.java index 4c4d7c9429..c92d78ad40 100644 --- a/designer-base/src/main/java/com/fr/design/env/HttpWorkspaceConnector.java +++ b/designer-base/src/main/java/com/fr/design/env/HttpWorkspaceConnector.java @@ -53,6 +53,10 @@ public class HttpWorkspaceConnector implements WorkspaceConnector { FineWorkspaceHttpClient client = FineWorkspaceHttpClient.create("Http-Client", connectionInfo); try { LoginResponseInfoBean bean = RemoteAuthorityRepository.getInstance().login(createLoginBean(connectionInfo)); + // 服务器如果没返回token,肯定是出问题了,直接抛出异常 + if (StringUtils.isEmpty(bean.getAccessToken())) { + throw new RuntimeException("Empty token, try connect again and check server"); + } WorkspaceConnection connection = new WorkspaceConnection( UUID.randomUUID().toString(), connectionInfo.getUserName(), diff --git a/designer-realize/src/main/java/com/fanruan/boot/init/DesignPreLoadComponent.java b/designer-realize/src/main/java/com/fanruan/boot/init/DesignPreLoadComponent.java index 744ce4b65c..736aa35096 100644 --- a/designer-realize/src/main/java/com/fanruan/boot/init/DesignPreLoadComponent.java +++ b/designer-realize/src/main/java/com/fanruan/boot/init/DesignPreLoadComponent.java @@ -12,6 +12,7 @@ import com.fanruan.plugin.autonomy.AutonomyClassManagerGroup; import com.fanruan.product.BuildContext; import com.fanruan.product.ProductConstants; import com.fr.base.OptimizeUtil; +import com.fr.concurrent.FineExecutors; import com.fr.config.dao.DaoSelectorFactory; import com.fr.config.dao.PropertiesConstants; import com.fr.decision.service.context.ServiceContext; @@ -74,6 +75,7 @@ import java.net.URLClassLoader; import java.util.ArrayList; import java.util.Locale; import java.util.Set; +import java.util.Timer; import java.util.concurrent.TimeUnit; /** @@ -226,6 +228,12 @@ public class DesignPreLoadComponent { try { beforeAllStart(); //清空临时文件 + FineExecutors.newSingleThreadScheduledExecutor().scheduleWithFixedDelay(new Runnable() { + @Override + public void run() { + TmpFileUtils.cleanUpInnerTmpFiles(); + } + }, 10, 10, TimeUnit.MINUTES); Runtime.getRuntime().addShutdownHook(new Thread(TmpFileUtils::cleanUpInnerTmpFiles)); RestartHelper.deleteRecordFilesWhenStart(); CloudCenter.getInstance();