From 78ced847740e1c6100a924a0d4975e71f6c8fb39 Mon Sep 17 00:00:00 2001 From: WebStreamr <210764791+webstreamr@users.noreply.github.com> Date: Fri, 8 Aug 2025 08:24:23 +0000 Subject: [PATCH] chore(fetcher): block a host temporarily after 30 times timing out instead of 10 --- src/utils/Fetcher.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/utils/Fetcher.ts b/src/utils/Fetcher.ts index 2c4e1d5..8317f06 100644 --- a/src/utils/Fetcher.ts +++ b/src/utils/Fetcher.ts @@ -57,7 +57,7 @@ export class Fetcher { private readonly DEFAULT_TIMEOUT = 15000; private readonly DEFAULT_QUEUE_LIMIT = 5; private readonly DEFAULT_QUEUE_TIMEOUT = 5000; - private readonly DEFAULT_FAILED_REQUEST_COUNT_THROW = 10; + private readonly DEFAULT_TIMEOUTS_COUNT_THROW = 30; private readonly TIMEOUT_CACHE_TTL = 3600000; // 1h private readonly logger: winston.Logger; @@ -256,7 +256,7 @@ export class Fetcher { throw new TooManyRequestsError(this.rateLimitedCache.getRemainingTTL(url.host) / 1000); } - if ((this.timeoutsCountCache.get(url.host) ?? 0) >= (init?.timeoutsCountThrow ?? this.DEFAULT_FAILED_REQUEST_COUNT_THROW)) { + if ((this.timeoutsCountCache.get(url.host) ?? 0) >= (init?.timeoutsCountThrow ?? this.DEFAULT_TIMEOUTS_COUNT_THROW)) { throw new TooManyTimeoutsError(); }