From 881fed53a4d87e96f4d10dbeb5f83ee0390bf24d Mon Sep 17 00:00:00 2001 From: WebStreamr <210764791+webstreamr@users.noreply.github.com> Date: Sat, 28 Jun 2025 17:14:51 +0000 Subject: [PATCH] chore(fetcher): configure max for all TTLCaches --- src/utils/Fetcher.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/utils/Fetcher.ts b/src/utils/Fetcher.ts index 57edf53..5d506d1 100644 --- a/src/utils/Fetcher.ts +++ b/src/utils/Fetcher.ts @@ -61,13 +61,13 @@ export class Fetcher { private readonly logger: winston.Logger; private readonly dispatcher: Dispatcher | undefined; - private readonly httpCache = new TTLCache(); - private readonly rateLimitedCache = new TTLCache(); + private readonly httpCache = new TTLCache({ max: 1024 }); + private readonly rateLimitedCache = new TTLCache({ max: 1024 }); private readonly semaphores = new Map(); private readonly hostUserAgentMap = new Map(); private readonly cookieJar = new CookieJar(); - private readonly timeoutsCountCache = new TTLCache(); + private readonly timeoutsCountCache = new TTLCache({ max: 1024 }); private readonly timeoutsCountMutex = new Mutex(); public constructor(logger: winston.Logger) {