Skip to content

Make timeout configurable in downloadFile() #139

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

Merged
merged 1 commit into from
Jul 4, 2023
Merged

Make timeout configurable in downloadFile() #139

merged 1 commit into from
Jul 4, 2023

Conversation

yihui
Copy link
Contributor

@yihui yihui commented Dec 14, 2022

The default 120 seconds may not be enough, e.g., #138 and https://d.cosx.org/d/423763

Timeout was reached: [] Operation timed out after 120000 milliseconds with 47824896 out of 156738322 bytes received...

After this PR, they can increase the value by, e.g., options(timeout = 600) (10 mins).

options('timeout') defaults to 60 in base R, so this PR won't change your default (max(60, 120) == 120).

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
Users can increase `options(timeout)` if the default is not enough, e.g., #138 and https://d.cosx.org/d/423763
@khughitt
Copy link
Contributor

Nice and simple fix 👍

It's probably also worth modifying the similar call in getGEOSuppFiles.R.

@khughitt
Copy link
Contributor

One more place that needs to be modified is parseGEO.R:getAndParseGSEMatrices:

Error in open.connection(x, "rb") :
  Timeout was reached: [ftp.ncbi.nlm.nih.gov] Resolving timed out after 10000 milliseconds
Calls: download_geo ... getAndParseGSEMatrices -> getDirListing -> <Anonymous> -> read_html.default
Execution halted

@yihui
Copy link
Contributor Author

yihui commented Mar 19, 2023

I can definitely do that, but first we need to get @seandavi's attention.

@seandavi seandavi merged commit 58225fa into seandavi:devel Jul 4, 2023
@yihui yihui deleted the patch-1 branch July 5, 2023 02:13
@jacorvar
Copy link

Hi,

in spite of increasing timeout with options(timeout=3000), downloadFile keeps using 120 seconds. Am I doing something wrong?

I've installed the latest version using install_github('seandavi/GEOquery') and R version 4.3.1 (2023-06-16).

@yihui
Copy link
Contributor Author

yihui commented Oct 30, 2023

Make sure to restart R after (re)installing a package.

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.

None yet

4 participants