From: Michael Tremer Date: Sun, 15 Sep 2024 03:40:34 +0000 (+0000) Subject: daemon: Keep the stats timer running continuously X-Git-Tag: 0.9.30~1192 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=aea8760cad56a0624b17536aef3cf94ca3d6cbd2;p=pakfire.git daemon: Keep the stats timer running continuously Signed-off-by: Michael Tremer --- diff --git a/src/libpakfire/daemon.c b/src/libpakfire/daemon.c index 8d2165556..0a51f9619 100644 --- a/src/libpakfire/daemon.c +++ b/src/libpakfire/daemon.c @@ -247,13 +247,6 @@ static int pakfire_daemon_submit_stats(sd_event_source* s, uint64_t usec, void* return r; } - // Activate the timer - r = sd_event_source_set_enabled(daemon->stat_timer, SD_EVENT_ONESHOT); - if (r < 0) { - CTX_ERROR(daemon->ctx, "Could not activate the stat timer: %s\n", strerror(-r)); - return r; - } - // Don't do anything if we don't have a control connection if (!daemon->control) { CTX_DEBUG(daemon->ctx, "Won't send stats without a control connection\n"); @@ -319,6 +312,13 @@ static int pakfire_daemon_setup_loop(struct pakfire_daemon* daemon) { return r; } + // Submit stats continuously + r = sd_event_source_set_enabled(daemon->stat_timer, SD_EVENT_ON); + if (r < 0) { + CTX_ERROR(daemon->ctx, "Could not activate the stat timer: %s\n", strerror(-r)); + return r; + } + return 0; }