From: Michael Tremer Date: Sat, 25 Jan 2025 17:54:12 +0000 (+0000) Subject: daemon: Reset the reconnection timer on connect X-Git-Tag: 0.9.30~376 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=118ed7d46ee801026697f410d66c646cd828c182;p=pakfire.git daemon: Reset the reconnection timer on connect This used to be reset in the wrong place; when a build job was received. Signed-off-by: Michael Tremer --- diff --git a/src/pakfire/daemon.c b/src/pakfire/daemon.c index c4a35a1c..78ec35c1 100644 --- a/src/pakfire/daemon.c +++ b/src/pakfire/daemon.c @@ -394,9 +394,6 @@ static int pakfire_daemon_recv(struct pakfire_xfer* xfer, struct json_object* m = NULL; int r; - // Reset the holdoff timer - daemon->reconnect_holdoff = 1000000; - // Parse the JSON message m = pakfire_json_parse(daemon->ctx, message, size); if (!m) { @@ -520,6 +517,9 @@ static int pakfire_daemon_connected(struct pakfire_xfer* xfer, void* data) { // Store a reference to the control connection daemon->control = pakfire_xfer_ref(xfer); + // Reset the holdoff timer + daemon->reconnect_holdoff = 1000000; + // Submit stats r = sd_event_add_time_relative(daemon->loop, &daemon->stats_timer, CLOCK_MONOTONIC, 0, 0, pakfire_daemon_submit_stats, daemon);