Merge branch 'dev' into pr@dev_memory_component

This commit is contained in:
dataeaseShu 2023-02-01 16:12:37 +08:00
commit 52b8ab599e

View File

@ -292,6 +292,7 @@ public class DatasourceService {
public void updateDatasource(String id, Datasource datasource) {
DatasourceExample example = new DatasourceExample();
example.createCriteria().andIdEqualTo(id);
checkAndUpdateDatasourceStatus(datasource);
datasourceMapper.updateByExampleSelective(datasource, example);
handleConnectionPool(id);
}
@ -363,7 +364,6 @@ public class DatasourceService {
DatasourceRequest datasourceRequest = new DatasourceRequest();
datasourceRequest.setDatasource(datasource);
datasourceStatus = datasourceProvider.checkStatus(datasourceRequest);
if (datasource.getType().equalsIgnoreCase("api")) {
List<ApiDefinition> apiDefinitionList = new Gson().fromJson(datasource.getConfiguration(), new TypeToken<List<ApiDefinition>>() {
}.getType());
@ -377,6 +377,7 @@ public class DatasourceService {
}
}
if (success == apiDefinitionList.size()) {
datasource.setStatus(datasourceStatus);
return ResultHolder.success(datasource);
}
if (success > 0 && success < apiDefinitionList.size()) {