[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

[tor-commits] [snowflake-mobile/master] Added read time-out for OkHttpClient



commit fd5ab01e54c0c271ead577b7100010cd6714afba
Author: Hashik Donthineni <HashikDonthineni@xxxxxxxxx>
Date:   Wed Jun 17 23:24:22 2020 +0530

    Added read time-out for OkHttpClient
---
 .../org/torproject/snowflake/services/RetroServiceGenerator.java    | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/app/src/main/java/org/torproject/snowflake/services/RetroServiceGenerator.java b/app/src/main/java/org/torproject/snowflake/services/RetroServiceGenerator.java
index 9bbb945..43d80fd 100644
--- a/app/src/main/java/org/torproject/snowflake/services/RetroServiceGenerator.java
+++ b/app/src/main/java/org/torproject/snowflake/services/RetroServiceGenerator.java
@@ -3,6 +3,8 @@ package org.torproject.snowflake.services;
 import org.torproject.snowflake.BuildConfig;
 import org.torproject.snowflake.GlobalApplication;
 
+import java.util.concurrent.TimeUnit;
+
 import hu.akarnokd.rxjava3.retrofit.RxJava3CallAdapterFactory;
 import okhttp3.OkHttpClient;
 import okhttp3.logging.HttpLoggingInterceptor;
@@ -21,7 +23,9 @@ public class RetroServiceGenerator {
 
         OkHttpClient.Builder httpClient =
                 new OkHttpClient.Builder();
-        //TODO:Set Custom Time Out (Long Polling)
+        //Setting a custom timeouts.
+        httpClient.readTimeout(15, TimeUnit.SECONDS);
+
         if (BuildConfig.DEBUG) {
             HttpLoggingInterceptor interceptor = new HttpLoggingInterceptor();
             interceptor.level(HttpLoggingInterceptor.Level.BODY);

_______________________________________________
tor-commits mailing list
tor-commits@xxxxxxxxxxxxxxxxxxxx
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits