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 possibility to change the timeout for the curl's connect phase #125

Merged
merged 5 commits into from
Apr 22, 2024

Conversation

gladkia
Copy link
Contributor

@gladkia gladkia commented Apr 22, 2024

Hi @gaborcsardi,

Please find a small PR with suggestions on how to implement this improvement.

Details:

  • the timeout is set to 60[s] by default
  • the timeout can be changed via options(timeout = X_SECONDS)

Example scenario:

> options(timeout = 2)
> getOption("timeout")
[1] 2
> Sys.setenv(R_PKG_SEARCH_SERVER = "search.r-pkg.org:4321")
> pkgsearch::advanced_search(Author = "John", Author = "Doe")
Error in curl::curl_fetch_memory(url, handle = handle) : 
  Timeout was reached: [search.r-pkg.org:4321] Connection timed out after 2003 milliseconds
> Sys.getenv("R_PKG_SEARCH_SERVER")
[1] "search.r-pkg.org:4321"
> Sys.unsetenv("R_PKG_SEARCH_SERVER")
> pkgsearch::advanced_search(Author = "John", Author = "Doe")
- "advanced search" ---------------------------------------------------------------------- 0 packages in 0.024 seconds 

@gaborcsardi gaborcsardi merged commit d613795 into r-hub:main Apr 22, 2024
1 of 12 checks passed
@gaborcsardi
Copy link
Contributor

Thank you!

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