Skip to content

Improve Netzschleuder code #38

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

Open
4 of 5 tasks
krlmlr opened this issue Apr 28, 2025 · 2 comments · May be fixed by #40
Open
4 of 5 tasks

Improve Netzschleuder code #38

krlmlr opened this issue Apr 28, 2025 · 2 comments · May be fixed by #40
Assignees

Comments

@krlmlr
Copy link
Contributor

krlmlr commented Apr 28, 2025

@schochastics
Copy link
Contributor

@krlmlr What is the advantage of resp_stream_raw()? Should this replace the current logic of checking filesize beforehand and only download if it doesn't go over a certain limit?

byte_size <- as.numeric(httr2::resp_headers(resp)[["content-length"]])
gb_size <- round(byte_size / 1024^3, 4)
if (gb_size > size_limit) {
cli::cli_abort(c(
"{zip_url} has a size of {gb_size} GB and exceeds the size limit of {size_limit} GB.",
"i" = "To download the file, set {.arg size_limit} to a value greater than {gb_size}"
))
}

@schochastics schochastics linked a pull request Apr 29, 2025 that will close this issue
@krlmlr
Copy link
Contributor Author

krlmlr commented Apr 29, 2025

We can read in chunks of 1 MB or so, and are no longer limited regarding file size. The current code loads the entire file into RAM. I suspect this will also help with rate limiting, need to check.

Thinking about it, we need RAM proportional to the graph size anyway, so perhaps not important?

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 a pull request may close this issue.

2 participants