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

feat: add a timeout option for http client #2600

Merged
merged 2 commits into from
Apr 8, 2022
Merged

feat: add a timeout option for http client #2600

merged 2 commits into from
Apr 8, 2022

Conversation

dvikan
Copy link
Contributor

@dvikan dvikan commented Apr 3, 2022

No description provided.

@Bockiii
Copy link
Contributor

Bockiii commented Apr 4, 2022

Which problem adresses this?

@dvikan
Copy link
Contributor Author

dvikan commented Apr 4, 2022

This change makes it possible to configure a default value for how long curl waits before considering it a network failure. Right now it waits 60 seconds before timing out.

In my automatic testing I want to lower this threshold to maybe 10 seconds. But a bridge instance might want to have a different default timeout value. In any case, each bridge can override this timeout value in their call to getContents.

@Bockiii
Copy link
Contributor

Bockiii commented Apr 4, 2022

So it's keeping the current default while adding a config option? Okay, sounds good. Can you add some documentation for this to the /docs section? Thanks

@dvikan
Copy link
Contributor Author

dvikan commented Apr 4, 2022

Yeah the prior value was 60 because it's using the php.ini value from default_socket_timeout which is usually 60. Atleast that's what it is in debian/ubuntu for both fpm and cli. Yeah ill add to docs for it.

@Bockiii
Copy link
Contributor

Bockiii commented Apr 4, 2022

LGTM!

@dvikan
Copy link
Contributor Author

dvikan commented Apr 4, 2022

I think that eventually we want to lower this value when we introduce retry logic. E.g. if it times out for 15s, it aborts and tries again. That's for a later concern though. Ideally it has retry logic by default, which can be turned off from the client call.

@dvikan dvikan merged commit cce1196 into RSS-Bridge:master Apr 8, 2022
@dvikan dvikan deleted the curl-timeout branch April 8, 2022 19:22
Kwbmm pushed a commit to Kwbmm/rss-bridge that referenced this pull request Jun 17, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants