From: Michael Tremer Date: Mon, 20 Oct 2025 09:04:06 +0000 (+0000) Subject: sources: Properly turn off the event when we disable a source X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ce95b03f99daafecb1eb401f838b81cd92f1f696;p=telemetry.git sources: Properly turn off the event when we disable a source Signed-off-by: Michael Tremer --- diff --git a/src/daemon/source.c b/src/daemon/source.c index 309d1d1..450e238 100644 --- a/src/daemon/source.c +++ b/src/daemon/source.c @@ -330,6 +330,12 @@ static int td_source_heartbeat(sd_event_source* source, uint64_t usec, void* dat r = sd_event_source_set_enabled(self->events.heartbeat, SD_EVENT_ON); if (r < 0) return r; + + // Or turn it off entirely + } else { + r = sd_event_source_set_enabled(self->events.heartbeat, SD_EVENT_OFF); + if (r < 0) + return r; } return 0;