From 998e9cce02c65cab525926da1aee4104f596ecd8 Mon Sep 17 00:00:00 2001 From: gnuxie Date: Wed, 6 Jul 2022 12:15:45 +0100 Subject: [PATCH] Warn when giving up on being throttled --- src/utils.ts | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/utils.ts b/src/utils.ts index b42038e..d30609f 100644 --- a/src/utils.ts +++ b/src/utils.ts @@ -386,6 +386,9 @@ function patchMatrixClientForRetry() { // We need to retry. reject(err); } else { + if (attempt >= MAX_REQUEST_ATTEMPTS) { + LogService.warn('Mjolnir.client', `Retried request ${params.method} ${params.uri} ${attempt} times, giving up.`); + } // No need-to-retry error? Lucky us! // Note that this may very well be an error, just not // one we need to retry.