Skip to content

Commit

Permalink
Increase network timeouts to 30 seconds
Browse files Browse the repository at this point in the history
  • Loading branch information
b-lam committed Jun 30, 2020
1 parent 032a9c2 commit 0d8d42b
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions app/src/main/java/com/b_lam/resplash/di/NetworkModule.kt
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,9 @@ private fun createOkHttpClient(accessTokenInterceptor: AccessTokenInterceptor):
.addNetworkInterceptor(createHeaderInterceptor())
.addInterceptor(createHttpLoggingInterceptor())
.addInterceptor(accessTokenInterceptor)
.connectTimeout(30, TimeUnit.SECONDS)
.readTimeout(30, TimeUnit.SECONDS)
.writeTimeout(30, TimeUnit.SECONDS)
.build()
}

Expand All @@ -65,9 +68,7 @@ private fun createHttpLoggingInterceptor(): Interceptor {
private fun createAccessTokenInterceptor(
accessTokenProvider: AccessTokenProvider
): AccessTokenInterceptor {
return AccessTokenInterceptor(
accessTokenProvider
)
return AccessTokenInterceptor(accessTokenProvider)
}

private fun createConverterFactory(): MoshiConverterFactory {
Expand Down

0 comments on commit 0d8d42b

Please sign in to comment.