retry_patiently: Evaluate an expression with retries, waiting between tries

Description Usage Arguments

View source: R/retry_patiently.R

Description

Waits progressively longer before each next try (at least by default; wait times can be customized).

Usage

1
2
3
4
5
6
retry_patiently(
  expr,
  max_wait_times = c(0, 3^c(0:4)),
  min_wait_frac = 0.5,
  verbose = FALSE
)

Arguments

expr

expression to evaluate

max_wait_times

vector of maximum wait times, in seconds, before trying the 1st, 2nd, etc. time. The length of this vector is the maximum number of tries.

min_wait_frac

numeric between 0 and 1. If < 1, the actual wait time before try i will be a uniform random value selected from the range (min_wait_frac*max_wait_times[i], max_wait_times[i]). Modeled loosely on https://github.com/r-lib/httr/blob/master/R/retry.R.

verbose

logical. Should informational messages be printed?


aappling-usgs/scipiper documentation built on Aug. 1, 2020, 3:11 p.m.