Skip to content

Commit

Permalink
Fix inability to await success conditions
Browse files Browse the repository at this point in the history
  • Loading branch information
alainbryden committed Oct 15, 2024
1 parent b23c57b commit 7f3d692
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion helpers.js
Original file line number Diff line number Diff line change
Expand Up @@ -368,7 +368,7 @@ export async function autoRetry(ns, fnFunctionThatMayFail, fnSuccessCondition, e
// Check if this is considered a successful result
sucessConditionMet = fnSuccessCondition(result);
if (sucessConditionMet instanceof Promise)
sucessConditionMet = await errorMessage; // If fnSuccessCondition was async, await its result
sucessConditionMet = await sucessConditionMet; // If fnSuccessCondition was async, await its result
if (!sucessConditionMet) {
// If we have not yet reached our maximum number of retries, we can continue, without throwing
if (attempts < maxRetries) {
Expand Down

0 comments on commit 7f3d692

Please sign in to comment.