Skip to content

Commit

Permalink
feat(youtube/return-youtube-dislike): decrease request timeout (#171)
Browse files Browse the repository at this point in the history
  • Loading branch information
oSumAtrIX committed Oct 6, 2022
1 parent f5a4e6f commit c372e0e
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ public static void fetchDislikes(String videoId) {
try {
LogHelper.debug(ReturnYouTubeDislikeApi.class, "Fetching dislikes for " + videoId);
HttpURLConnection connection = getConnectionFromRoute(ReturnYouTubeDislikeRoutes.GET_DISLIKES, videoId);
connection.setConnectTimeout(5 * 1000);
connection.setConnectTimeout(1000);
if (connection.getResponseCode() == 200) {
JSONObject json = getJSONObject(connection);
dislikeCount = json.getInt("dislikes");
Expand Down Expand Up @@ -181,4 +181,4 @@ private static HttpURLConnection getConnectionFromRoute(Route route, String... p
private static JSONObject getJSONObject(HttpURLConnection connection) throws Exception {
return Requester.getJSONObject(connection);
}
}
}

0 comments on commit c372e0e

Please sign in to comment.