Azure / AzureStor

R interface to Azure storage accounts
Other
64 stars 20 forks source link

timeout argument in function AzureStor::call_storage_endpoint is ignored #105

Closed spitzem closed 3 years ago

spitzem commented 3 years ago

The argument 'timeout' is set but not used in call_storage_endpoint. A fix that works for me is:

response <- tryCatch(httr::VERB(http_verb, url, do.call(httr::add_headers, headers), body=body, progress, httr::timeout(getOption("azure_storage_timeout"))), error=function(e) e)

This depends on ensuring getOption("azure_storage_timeout") has a valid return somewhere else. It also makes the function argument 'timeout' for the call_storage_endpoint obsolete.

hongooi73 commented 3 years ago

Thanks for reporting this. I wouldn't use an external check on the timeout like that; the call may actually succeed on the backend, even though R reports an error. This can lead to problems down the track, if you assume the error means the call failed.