diff options
author | Lizzy Hunt <lizzy.hunt@usu.edu> | 2023-10-11 11:06:35 -0600 |
---|---|---|
committer | Lizzy Hunt <lizzy.hunt@usu.edu> | 2023-10-11 11:06:35 -0600 |
commit | 7331da69aa3442d7edaed4160b5a6bd3239ed265 (patch) | |
tree | 886b4ab68be0fff4b4da603563dec0a30a32b98b /src/exponential_retry.js | |
parent | 5a7f1ac4c9ec3044bef6dee6f7f6d7f51046526b (diff) | |
download | aggietimed-7331da69aa3442d7edaed4160b5a6bd3239ed265.tar.gz aggietimed-7331da69aa3442d7edaed4160b5a6bd3239ed265.zip |
Diffstat (limited to 'src/exponential_retry.js')
-rw-r--r-- | src/exponential_retry.js | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/exponential_retry.js b/src/exponential_retry.js index 96ca979..66c78d3 100644 --- a/src/exponential_retry.js +++ b/src/exponential_retry.js @@ -11,12 +11,12 @@ export const with_exponential_retry = async ( promise_fn, validation_fn = (x) => Promise.resolve(!!x), max_retries = MAX_DEFAULT_RETRY_AMOUNT, - retries = 0 + retries = 0, ) => { try { if (retries) await wait_for( - WAIT_MS * Math.pow(RETRY_EXPONENT, RETRY_EXPONENTIAL_FACTOR * retries) + WAIT_MS * Math.pow(RETRY_EXPONENT, RETRY_EXPONENTIAL_FACTOR * retries), ); const res = await promise_fn(); @@ -29,7 +29,7 @@ export const with_exponential_retry = async ( promise_fn, validation_fn, max_retries, - retries + 1 + retries + 1, ); } }; |