Browse Source

fix: checkstyle

master
vran 3 years ago
parent
commit
6deb8b92e9
  1. 7
      core/src/main/java/com/databasir/core/config/RestTemplateConfig.java
  2. 5
      core/src/main/java/com/databasir/core/infrastructure/connection/CustomDatabaseConnectionFactory.java

7
core/src/main/java/com/databasir/core/config/RestTemplateConfig.java

@ -19,14 +19,15 @@ public class RestTemplateConfig {
restTemplate.getMessageConverters().set(1,
new StringHttpMessageConverter(StandardCharsets.UTF_8));
return restTemplate;
}
@Bean
public ClientHttpRequestFactory simpleClientHttpRequestFactory() {
SimpleClientHttpRequestFactory factory = new SimpleClientHttpRequestFactory();
factory.setReadTimeout(1000 * 30);//单位为ms
factory.setConnectTimeout(1000 * 5);//单位为ms
//单位为ms
factory.setReadTimeout(1000 * 30);
//单位为ms
factory.setConnectTimeout(1000 * 5);
return factory;
}
}

5
core/src/main/java/com/databasir/core/infrastructure/connection/CustomDatabaseConnectionFactory.java

@ -65,7 +65,10 @@ public class CustomDatabaseConnectionFactory implements DatabaseConnectionFactor
} catch (ClassNotFoundException e) {
log.error("init driver error", e);
throw DomainErrors.CONNECT_DATABASE_FAILED.exception("驱动初始化异常, 请检查 Driver name:" + e.getMessage());
} catch (InvocationTargetException | InstantiationException | IllegalAccessException | NoSuchMethodException e) {
} catch (InvocationTargetException
| InstantiationException
| IllegalAccessException
| NoSuchMethodException e) {
log.error("init driver error", e);
throw DomainErrors.CONNECT_DATABASE_FAILED.exception("驱动初始化异常:" + e.getMessage());
}

Loading…
Cancel
Save