Skip to content
Permalink
Browse files

Increase timeouts for Trakt and Tmdb clients

  • Loading branch information...
chrisbanes committed Aug 27, 2019
1 parent 053e26d commit 36c9062caeb4eb3c580bb889ed6bb13eab075b42
@@ -23,6 +23,7 @@ import okhttp3.Cache
import okhttp3.OkHttpClient
import okhttp3.logging.HttpLoggingInterceptor
import java.io.File
import java.util.concurrent.TimeUnit
import javax.inject.Named
import javax.inject.Singleton

@@ -41,6 +42,9 @@ class TmdbModule {
builder.apply {
addInterceptor(interceptor)
cache(Cache(File(cacheDir, "tmdb_cache"), 10 * 1024 * 1024))
connectTimeout(20, TimeUnit.SECONDS)
readTimeout(20, TimeUnit.SECONDS)
writeTimeout(20, TimeUnit.SECONDS)
}
}
}
@@ -34,6 +34,7 @@ import okhttp3.Cache
import okhttp3.OkHttpClient
import okhttp3.logging.HttpLoggingInterceptor
import java.io.File
import java.util.concurrent.TimeUnit
import javax.inject.Named
import javax.inject.Singleton

@@ -52,6 +53,9 @@ class TraktAuthModule {
builder.apply {
addInterceptor(interceptor)
cache(Cache(File(cacheDir, "trakt_cache"), 10 * 1024 * 1024))
connectTimeout(20, TimeUnit.SECONDS)
readTimeout(20, TimeUnit.SECONDS)
writeTimeout(20, TimeUnit.SECONDS)
}
}
}

0 comments on commit 36c9062

Please sign in to comment.
You can’t perform that action at this time.