From 4ce7c5112cca021e1e89abe8b7ddefb968b01d0d Mon Sep 17 00:00:00 2001 From: codeforkjeff Date: Sun, 15 Jan 2017 10:58:28 -0500 Subject: [PATCH] set 20sec conn and read timeouts for VIAF --- src/main/java/com/codefork/refine/viaf/VIAFService.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/main/java/com/codefork/refine/viaf/VIAFService.java b/src/main/java/com/codefork/refine/viaf/VIAFService.java index 8316685..ecea785 100644 --- a/src/main/java/com/codefork/refine/viaf/VIAFService.java +++ b/src/main/java/com/codefork/refine/viaf/VIAFService.java @@ -15,6 +15,8 @@ @Service public class VIAFService { + public static int TIMEOUT = 20000; + Log log = LogFactory.getLog(VIAFService.class); /** @@ -28,6 +30,8 @@ public HttpURLConnection doSearch(String cql, int limit) throws IOException { UriUtils.encodeQueryParam(cql, "UTF-8"), limit); log.debug("Making request to " + url); HttpURLConnection connection = (HttpURLConnection) new URL(url).openConnection(); + connection.setConnectTimeout(TIMEOUT); + connection.setReadTimeout(TIMEOUT); return connection; }