mirror of
http://git.pig4cloud.com/pig/pigx.git
synced 2026-11-14 14:19:08 +08:00
🐛 Fixing a bug. #1534 amazonaws oss Unable to execute HTTP request: Timeout waiting for connection from pool
This commit is contained in:
1 parent
81af2b2dc8
commit
ec3bbd900e
3 files changed
+13
-6
No files matched your search
+5
@@ -77,4 +77,9 @@ public class OssProperties {
|
||||
*/
|
||||
private String bucketName = "payerp";
|
||||
|
||||
/**
|
||||
* 最大线程数,默认: 100
|
||||
*/
|
||||
private Integer maxConnections = 100;
|
||||
|
||||
}
|
||||
+5
-3
@@ -138,8 +138,8 @@ public class OssTemplate implements InitializingBean {
|
||||
* API Documentation</a>
|
||||
*/
|
||||
@SneakyThrows
|
||||
public InputStream getObject(String bucketName, String objectName) {
|
||||
return amazonS3.getObject(bucketName, objectName).getObjectContent();
|
||||
public S3Object getObject(String bucketName, String objectName) {
|
||||
return amazonS3.getObject(bucketName, objectName);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -203,8 +203,10 @@ public class OssTemplate implements InitializingBean {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void afterPropertiesSet() throws Exception {
|
||||
public void afterPropertiesSet() {
|
||||
ClientConfiguration clientConfiguration = new ClientConfiguration();
|
||||
clientConfiguration.setMaxConnections(ossProperties.getMaxConnections());
|
||||
|
||||
AwsClientBuilder.EndpointConfiguration endpointConfiguration = new AwsClientBuilder.EndpointConfiguration(
|
||||
ossProperties.getEndpoint(), ossProperties.getRegion());
|
||||
AWSCredentials awsCredentials = new BasicAWSCredentials(ossProperties.getAccessKey(),
|
||||
|
||||
Reference in new issue
Block a user