Skip to content

Commit

Permalink
Merge pull request #250 from nimblehq/chore/217-increase-timeout-http…
Browse files Browse the repository at this point in the history
…client

[#217] Increase timeout in OkHttpClient to 30 seconds
  • Loading branch information
toby-thanathip authored Jul 1, 2022
2 parents dd27738 + 02acc42 commit 09539ab
Showing 1 changed file with 4 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@ import dagger.hilt.InstallIn
import dagger.hilt.components.SingletonComponent
import okhttp3.OkHttpClient
import okhttp3.logging.HttpLoggingInterceptor
import java.util.concurrent.TimeUnit

private const val READ_TIME_OUT = 30L

@Module
@InstallIn(SingletonComponent::class)
Expand All @@ -18,6 +21,7 @@ class OkHttpClientModule {
addInterceptor(HttpLoggingInterceptor().apply {
level = HttpLoggingInterceptor.Level.BODY
})
readTimeout(READ_TIME_OUT, TimeUnit.SECONDS)
}
}.build()
}

0 comments on commit 09539ab

Please sign in to comment.