Skip to content

Commit

Permalink
feat: retry up to 3 times if GET fails
Browse files Browse the repository at this point in the history
  • Loading branch information
ymarcon committed Dec 22, 2023
1 parent 91a8f1f commit b731e19
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions R/opal.R
Original file line number Diff line number Diff line change
Expand Up @@ -232,9 +232,9 @@ opal.version_compare <- function(opal, version) {
opal.get <- function(opal, ..., query = list(), acceptType = 'application/json', outFile = NULL, callback = NULL) {
r <- NULL
if (is.null(outFile))
r <- GET(.url(opal, ...), query = query, accept(acceptType), config = opal$config, handle = opal$handle, .verbose())
r <- RETRY('GET', .url(opal, ...), query = query, accept(acceptType), config = opal$config, handle = opal$handle, .verbose())
else
r <- GET(.url(opal, ...), query = query, accept(acceptType), write_disk(outFile, overwrite = TRUE), config = opal$config, handle = opal$handle, .verbose())
r <- RETRY('GET', .url(opal, ...), query = query, accept(acceptType), write_disk(outFile, overwrite = TRUE), config = opal$config, handle = opal$handle, .verbose())
.handleResponseOrCallback(opal, r, callback)
}

Expand Down

0 comments on commit b731e19

Please sign in to comment.