Skip to content

Commit

Permalink
Merge pull request #174 from paveltar/android_timeout_fix
Browse files Browse the repository at this point in the history
android timeout fix
  • Loading branch information
MaxToyberman authored Oct 16, 2024
2 parents b0a0796 + 67d6d2e commit 047531a
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions android/src/main/java/com/toyberman/Utils/OkHttpUtils.java
Original file line number Diff line number Diff line change
Expand Up @@ -88,21 +88,20 @@ public static OkHttpClient buildOkHttpClient(CookieJar cookieJar, String domainN


clientsByDomain.put(domainName, client);
return client;
} else {
client = clientsByDomain.get(domainName);
}

client = clientsByDomain.get(domainName);


if (options.hasKey("timeoutInterval")) {
int timeout = options.getInt("timeoutInterval");
// Copy to customize OkHttp for this request.
OkHttpClient client2 = client.newBuilder()
client = client.newBuilder()
.readTimeout(timeout, TimeUnit.MILLISECONDS)
.writeTimeout(timeout, TimeUnit.MILLISECONDS)
.connectTimeout(timeout, TimeUnit.MILLISECONDS)
.build();
return client2;
}


Expand Down

0 comments on commit 047531a

Please sign in to comment.