From 253dce54bdd03ea374dd046305b4c1cd854279ed Mon Sep 17 00:00:00 2001 From: Kim Schaefer Date: Tue, 29 Oct 2024 12:07:41 -0600 Subject: [PATCH] fixed error message --- src/lib/metrics.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/lib/metrics.ts b/src/lib/metrics.ts index 4f919e28e..8ec036848 100644 --- a/src/lib/metrics.ts +++ b/src/lib/metrics.ts @@ -173,7 +173,9 @@ export class MetricsCollector { if (maxCacheMissWindows !== undefined && this.#cacheMissWindows.size >= maxCacheMissWindows) { const firstKey = this.#cacheMissWindows.keys().next().value; - this.#cacheMissWindows.delete(firstKey); + if (firstKey !== undefined) { + this.#cacheMissWindows.delete(firstKey); + } this.#gauges.get(this.#getMetricName(this.#metricNames.cacheMiss))?.remove({ window: firstKey }); } };