From 1ea018320d1a8453005e8bb15e3ccb8c029fc138 Mon Sep 17 00:00:00 2001 From: Ross Williams Date: Wed, 5 Jun 2024 11:59:21 +0100 Subject: [PATCH] Mark the current run as successful --- stats-frontend/status.html | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/stats-frontend/status.html b/stats-frontend/status.html index 038c3c0..d57da4c 100644 --- a/stats-frontend/status.html +++ b/stats-frontend/status.html @@ -133,9 +133,12 @@ ) return durations.reduce((a, b) => (a + b)) / durations.length })() - if (now - nearestHour(now) < avgRunTime) + if (now - nearestHour(now) < avgRunTime) { + // Include this run in the success rate + successRate30Day = max(1, successRate30Day + 1 / (30 * 24)) return setStatus("waiting", successRate30Day, avgRunTime - (now - nearestHour(now))) - + } + // Run might overrun - allow up to 15 mins if (now - nearestHour(now) < 900) return setStatus("waiting", successRate30Day, 900 - (now - nearestHour(now)))