-
Notifications
You must be signed in to change notification settings - Fork 76
Closed
Labels
Description
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.
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 | |
) | |
} |