From 4836b47434b2a066c3409965d1c22c374a05da6b Mon Sep 17 00:00:00 2001 From: Felix Brucker Date: Wed, 17 Jan 2024 16:10:57 +0700 Subject: [PATCH] Improve slow block validation mapping --- src/analyzer/slow-block-validation.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/analyzer/slow-block-validation.ts b/src/analyzer/slow-block-validation.ts index 9f7e781..642b471 100644 --- a/src/analyzer/slow-block-validation.ts +++ b/src/analyzer/slow-block-validation.ts @@ -43,9 +43,10 @@ export function analyzeForSlowBlockValidation(warningLogLines: LogLine[]): SlowB percentFull: matches.length === 5 ? parseFloat(matches[4]) : undefined, } }) - .filter((warning): warning is BlockValidationWarning => warning !== undefined && warning.blockValidationTimeInSeconds >= 4) + .filter((warning): warning is BlockValidationWarning => warning !== undefined) - if (blockValidationWarnings.length === 0) { + const slowBlockValidationWarnings = blockValidationWarnings.filter(warning => warning.blockValidationTimeInSeconds >= 4) + if (slowBlockValidationWarnings.length === 0) { return { isSlow: false } }