forked from github/dataease
Merge pull request #6608 from dataease/pr@dev-v2@fixDatasource
fix: 初始化数据引擎失败
This commit is contained in:
commit
c5dd598647
@ -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());
|
||||
|
@ -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();
|
||||
|
Loading…
Reference in New Issue
Block a user