4343import org .slf4j .LoggerFactory ;
4444
4545import java .io .IOException ;
46+ import java .net .SocketException ;
47+ import java .net .SocketTimeoutException ;
4648import java .util .Collections ;
4749import java .util .concurrent .Callable ;
4850import java .util .concurrent .ExecutionException ;
@@ -58,7 +60,7 @@ public abstract class RestAPIClient {
5860 private static final int DEFAULT_CONNECT_TIMEOUT_MS = 12000 ;
5961
6062 /* Read Timeout in ms for waiting for data after the connection is established */
61- private static final int DEFAULT_READ_TIMEOUT_MS = 3600 ;
63+ private static final int DEFAULT_READ_TIMEOUT_MS = 300000 ;
6264
6365 private static final RequestConfig requestConfig = RequestConfig .custom ()
6466 .setConnectTimeout (DEFAULT_CONNECT_TIMEOUT_MS )
@@ -79,7 +81,7 @@ public RestAPIResponse executeGet(RestAPIRequest request) throws IOException {
7981 try (CloseableHttpResponse httpResponse = httpClient .execute (httpGet )) {
8082 return RestAPIResponse .parse (httpResponse , request .getResponseHeaders ());
8183 }
82- } catch (ConnectTimeoutException e ) {
84+ } catch (ConnectTimeoutException | SocketException e ) {
8385 ServiceNowAPIException exception = new ServiceNowAPIException (e , null );
8486 return new RestAPIResponse (Collections .emptyMap (), null , exception );
8587 }
0 commit comments