Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Reduce AWS/GCP API calls #958

@wlandau

Description

@wlandau

I think there is room to reduce calls to the AWS and GCP APIs. For example, this function below first checks if the target exists and only then checks the hash. That's 2 API calls for each existing target. I think we can get that down to 1.

targets/R/class_aws.R

Lines 225 to 254 in b3f0566

store_has_correct_hash.tar_aws <- function(store) {
path <- store$file$path
bucket <- store_aws_bucket(path)
region <- store_aws_region(path)
endpoint <- store_aws_endpoint(path)
key <- store_aws_key(path)
version <- store_aws_version(path)
if_any(
aws_s3_exists(
key = key,
bucket = bucket,
region = region,
endpoint = endpoint,
version = version,
args = store$resources$aws$args
),
identical(
store_aws_hash(
key = key,
bucket = bucket,
region = region,
endpoint = endpoint,
version = version,
args = store$resources$aws$args
),
store$file$hash
),
FALSE
)
}

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions