Skip to content

Commit

Permalink
fix: reduce huge timeout for http client
Browse files Browse the repository at this point in the history
  • Loading branch information
Joseph5610 committed Jul 10, 2024
1 parent 60b95a4 commit 7d4a588
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@ import java.util.concurrent.TimeUnit

private val logger = KotlinLogging.logger {}

private const val TIMEOUT_SECS: Long = 45 // Timeout for the duration of the whole call in seconds
private const val MAX_IDLE_CONNECTIONS: Int = 7
private const val TIMEOUT_SECS = 15L // Timeout for the duration of the whole call in seconds
private const val MAX_IDLE_CONNECTIONS = 7
private const val MAX_CACHE_SIZE = 100L * 1024L * 1024L // 100 MiB
private const val CACHE_BASE_DIR = "fxradio-http-cache"
private const val GOOGLE_DNS = "https://dns.google/dns-query"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,8 @@ class GetCoverArtUseCase : BaseUseCase<String, Maybe<Response>>() {
ReleaseWithCoverArt(coverUrl, it)
}
.doOnSuccess { logger.debug { "Requesting CoverArt: ${it.coverArtUrl}" } }
.doOnError { logger.error(it) { "Failed to retrieve CoverArt!" } }
.flatMapSingle { Single.fromCallable { HttpClient.request(it.coverArtUrl) } }
.doOnError { logger.error(it) { "Failed to retrieve CoverArt!" } }
.compose(applySchedulersMaybe())
.onErrorComplete()
}
Expand Down

0 comments on commit 7d4a588

Please sign in to comment.