From: Michael Tremer Date: Sun, 19 Oct 2025 13:08:08 +0000 (+0000) Subject: source: Disable all sources that fail all the time X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=cd54cf3d70059102490a2d8b38e526cf572a9294;p=telemetry.git source: Disable all sources that fail all the time Signed-off-by: Michael Tremer --- diff --git a/src/daemon/source.c b/src/daemon/source.c index 38feb36..e077b3d 100644 --- a/src/daemon/source.c +++ b/src/daemon/source.c @@ -207,8 +207,15 @@ static int collecty_source_error_detection(collecty_source* self, int result, ui collecty_source_name(self), collecty_source_count_bad_results(self)); } + // Count all bad results + int bad_results = collecty_source_count_bad_results(self); + + // Disable the source if it has failed + if (bad_results >= NUM_RESULTS) + state = STATE_DISABLED; + // If the last N attempts have been bad, we are in error state - if (collecty_source_count_bad_results(self) >= ERROR_THRESHOLD) + else if (bad_results >= ERROR_THRESHOLD) state = STATE_ERROR; // Check if we are flapping