Skip to content

Commit

Permalink
set 20sec conn and read timeouts for VIAF
Browse files Browse the repository at this point in the history
  • Loading branch information
codeforkjeff committed Jan 15, 2017
1 parent afd54ed commit 4ce7c51
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/main/java/com/codefork/refine/viaf/VIAFService.java
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@
@Service
public class VIAFService {

public static int TIMEOUT = 20000;

Log log = LogFactory.getLog(VIAFService.class);

/**
Expand All @@ -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;
}

Expand Down

0 comments on commit 4ce7c51

Please sign in to comment.