forked from github/dataease
perf: 优化启动时,数据集初始化
This commit is contained in:
parent
48897c2d1e
commit
2f0bbe7c8d
@ -323,11 +323,14 @@ public class DatasourceService {
|
||||
public void initAllDataSourceConnectionPool() {
|
||||
List<Datasource> datasources = datasourceMapper.selectByExampleWithBLOBs(new DatasourceExample());
|
||||
datasources.forEach(datasource -> {
|
||||
try {
|
||||
handleConnectionPool(datasource, "add");
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
commonThreadPool.addTask(()->{
|
||||
System.out.println(System.currentTimeMillis());
|
||||
try {
|
||||
handleConnectionPool(datasource, "add");
|
||||
} catch (Exception e) {
|
||||
LogUtil.error("Failed to init datasource: " + datasource.getName(), e);
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user