Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to set timeout? #126

Open
saldous opened this issue Nov 16, 2023 · 1 comment
Open

How to set timeout? #126

saldous opened this issue Nov 16, 2023 · 1 comment

Comments

@saldous
Copy link

saldous commented Nov 16, 2023

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
Copy link
Owner

prof18 commented Nov 16, 2023

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants