Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
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");
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;
}