Skip to content

req_perform_parallel does not cache results #447

@mkoohafkan

Description

@mkoohafkan

It appears that req_perform_parallel() does not cache results.

library(httr2)

# create cache directory
td = file.path(tempdir(), "cache")
dir.create(td)

url <- paste0(
  "https://raw.githubusercontent.com/allisonhorst/palmerpenguins/",
  "master/inst/extdata/penguins.csv"
)

req <- request(url) |> req_cache(td, debug = TRUE)

# First request downloads the data
resps <- req_perform_parallel(list(req))

# check for files in cache after parallel request, directory is empty
list.files(td)
## character(0)

resps <- req_perform_sequential(list(req))

# check for files in cache after sequential request, directory is not empty
list.files(td)
## [1] "d5d1ddd7f99f55dbc920c63f942804c0.rds"

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugan unexpected problem or unintended behavior

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions