retry_patiently: Evaluate an expression with retries, waiting between tries

View source: R/retry_patiently.R

retry_patientlyR Documentation

Evaluate an expression with retries, waiting between tries

Description

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

Usage

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?


USGS-R/scipiper documentation built on May 25, 2023, 8:47 a.m.