prof18 / RSS-Parser

A Kotlin Multiplatform library to parse a RSS Feed
Apache License 2.0
490 stars 126 forks source link

How to set timeout? #126

Open saldous opened 8 months ago

saldous commented 8 months ago

I tried this but it doesn't seem to work:

val client = OkHttpClient.Builder()
            .connectTimeout(5, TimeUnit.SECONDS)
            .build()

val rssBuilder = RssParserBuilder(
            callFactory = client
        )

val parser = rssBuilder.build()

It seems prof18.rssparser does not respect the timeout settings from the OkHttpClient.

prof18 commented 8 months ago

Have you tried setting also the read and write timeouts?

.connectTimeout(5, TimeUnit.SECONDS)
.writeTimeout(5, TimeUnit.SECONDS)
.readTimeout(5, TimeUnit.SECONDS)

btw, I'm not modifying the client that is injected, so every setting should work