Merge pull request #6608 from dataease/pr@dev-v2@fixDatasource

fix: 初始化数据引擎失败
This commit is contained in:
taojinlong 2023-11-08 04:14:02 -06:00 committed by GitHub
commit c5dd598647
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 9 additions and 3 deletions

View File

@ -122,8 +122,11 @@ public class EngineServer {
}
mysqlConfiguration.setHost(matcher.group(1));
mysqlConfiguration.setPort(Integer.valueOf(matcher.group(2)));
mysqlConfiguration.setDataBase(matcher.group(3).split("\\?")[0]);
mysqlConfiguration.setExtraParams(matcher.group(3).split("\\?")[1]);
String[] databasePrams = matcher.group(3).split("\\?");
mysqlConfiguration.setDataBase(databasePrams[0]);
if(databasePrams.length == 2){
mysqlConfiguration.setExtraParams(databasePrams[1]);
}
mysqlConfiguration.setUsername(env.getProperty("spring.datasource.username"));
mysqlConfiguration.setPassword(env.getProperty("spring.datasource.password"));
engine.setConfiguration(JsonUtil.toJSONString(mysqlConfiguration).toString());

View File

@ -34,7 +34,10 @@ public class DataSourceInitStartListener implements ApplicationListener<Applicat
public void onApplicationEvent(ApplicationReadyEvent applicationReadyEvent) {
try {
engineServer.initSimpleEngine();
datasourceServer.updateDemoDs();
}catch (Exception e){
e.printStackTrace();
}
try {
calciteProvider.initConnectionPool();
}catch (Exception e){
e.printStackTrace();