]> git.ipfire.org Git - pakfire.git/commitdiff
daemon: Reset the reconnection timer on connect
authorMichael Tremer <michael.tremer@ipfire.org>
Sat, 25 Jan 2025 17:54:12 +0000 (17:54 +0000)
committerMichael Tremer <michael.tremer@ipfire.org>
Sat, 25 Jan 2025 17:54:12 +0000 (17:54 +0000)
This used to be reset in the wrong place; when a build job was received.

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
src/pakfire/daemon.c

index c4a35a1cb707def234d8e6293ae0490703162dfb..78ec35c1e95f0c9ac5415baa6c43de56baa50e61 100644 (file)
@@ -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);