Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion R/credentials_gce.R
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ gce_metadata_request <- function(path, stop_on_error = TRUE) {
path <- substring(path, 2)
}
url <- paste0(root_url, "computeMetadata/v1/", path)
timeout <- getOption("gargle.gce.timeout", default = 0.8)
timeout <- getOption("gargle.gce.timeout", default = ifelse(!detect_gce(), 0.8, 2))
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This would seem to create a recursive call to gce_metadata_request().

Now that we seem to be converging on the right solution, I plan to make a PR that implements it.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jennybc Alright, thanks :)

response <- try({
httr::with_config(httr::timeout(timeout), {
httr::GET(url, httr::add_headers("Metadata-Flavor" = "Google"))
Expand Down