From 7f3d692cd1d4f3307c8d8ff9b0f08891c1198436 Mon Sep 17 00:00:00 2001 From: Alain Bryden <2285037+alainbryden@users.noreply.github.com> Date: Mon, 14 Oct 2024 23:22:16 -0300 Subject: [PATCH] Fix inability to await success conditions --- helpers.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/helpers.js b/helpers.js index b30d0590..866a0bb2 100644 --- a/helpers.js +++ b/helpers.js @@ -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) {