added connection timeout and socket timeout 600 sec
This commit is contained in:
parent
346ed65e2c
commit
1cb60aede4
|
@ -3,6 +3,7 @@ package eu.dnetlib.dhp.common.api;
|
||||||
|
|
||||||
import java.io.*;
|
import java.io.*;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
|
import java.util.concurrent.TimeUnit;
|
||||||
|
|
||||||
import com.google.gson.Gson;
|
import com.google.gson.Gson;
|
||||||
|
|
||||||
|
@ -92,7 +93,11 @@ public class ZenodoAPIClient implements Serializable {
|
||||||
* @return the response code
|
* @return the response code
|
||||||
*/
|
*/
|
||||||
public int uploadIS(InputStream is, String file_name, long len) throws IOException {
|
public int uploadIS(InputStream is, String file_name, long len) throws IOException {
|
||||||
OkHttpClient httpClient = new OkHttpClient();
|
OkHttpClient httpClient = new OkHttpClient
|
||||||
|
.Builder()
|
||||||
|
.connectTimeout(600, TimeUnit.SECONDS)
|
||||||
|
.readTimeout(600, TimeUnit.SECONDS)
|
||||||
|
.writeTimeout(600, TimeUnit.SECONDS).build();
|
||||||
|
|
||||||
Request request = new Request.Builder()
|
Request request = new Request.Builder()
|
||||||
.url(bucket + "/" + file_name)
|
.url(bucket + "/" + file_name)
|
||||||
|
|
Loading…
Reference in New Issue