From df78bb86f7e883b07a055c7c837653ce32e3d72a Mon Sep 17 00:00:00 2001 From: boufni95 Date: Thu, 9 Jan 2025 17:46:21 +0000 Subject: [PATCH] fix --- src/services/metrics/index.ts | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/services/metrics/index.ts b/src/services/metrics/index.ts index bcfcbc58..0a586e10 100644 --- a/src/services/metrics/index.ts +++ b/src/services/metrics/index.ts @@ -82,6 +82,9 @@ export default class Handler { past10m: { errors: 0, total: 0, from_unix: nowUnix - 60 * 10 }, past1m: { errors: 0, total: 0, from_unix: nowUnix - 60 }, } + if (last24h.length === 0) { + return stats + } for (let i = last24h.length; i >= 0; i--) { const e = last24h[i] if (e.ts < stats.past24h.from_unix) {