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

Index API client: add timeout to requests #482

Conversation

josecelano
Copy link
Member

@josecelano josecelano commented Feb 9, 2024

The API client does not have any timeout. The client waits indefinitely for responses. That should not be the default behaviour. It should return an error after a timeout. The users using the client should handle the timeout or any other error.

Subtasks

  • Move generic HTTP client to HTTP mod.
  • Generic HTTP client: Inject the scheme part of the URL in the constructor.
  • Add timeouts to the generic HTTP client.
  • Remove unwraps from the generic HTTP client. Return errors.
  • Remove unwraps from the Index API HTTP client. Return errors.

@josecelano josecelano linked an issue Feb 9, 2024 that may be closed by this pull request
@josecelano josecelano self-assigned this Feb 9, 2024
both in testing and production clients.
@josecelano josecelano force-pushed the 472-index-api-client-add-timeout-to-requests branch from ef11cc4 to 26422fc Compare February 9, 2024 16:29
I think we can consume the forms, they are not likely to be used anymore.
The Index API Client user must handle request errors.
We should handle timeouts errors, that have been added to the API
client.
@josecelano josecelano marked this pull request as ready for review February 9, 2024 17:12
@josecelano
Copy link
Member Author

ACK 47f5242

@josecelano josecelano merged commit 5a854f9 into torrust:develop Feb 9, 2024
8 of 10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Index API client: add timeout to requests
1 participant