From cb10ef45611db0c178fb7cf64200f21fa04f4bda Mon Sep 17 00:00:00 2001 From: Parthib Datta Date: Mon, 24 Jun 2024 12:54:33 +0530 Subject: [PATCH] Skip retry for registered wallets Signed-off-by: Parthib Datta --- typescript/src/lib/utils/backoff.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/typescript/src/lib/utils/backoff.ts b/typescript/src/lib/utils/backoff.ts index c5509d841..06ebce0ef 100644 --- a/typescript/src/lib/utils/backoff.ts +++ b/typescript/src/lib/utils/backoff.ts @@ -90,7 +90,9 @@ export function backoffRetrier( retries: number, backoffStepMs: number = 1000, logger: ExecutionLoggerFn = console.debug, - errorMatcher: ErrorMatcherFn = retryAll + errorMatcher: ErrorMatcherFn = skipRetryWhenMatched([ + "Wallet with the given ID has not been registered", + ]) ): RetrierFn { return async (fn: () => Promise): Promise => { for (let attempt = 0; attempt < retries; attempt++) {