From 587b1051ad451787f698660e40cf121e9ac20753 Mon Sep 17 00:00:00 2001 From: Abilio Marques Date: Tue, 17 Oct 2023 22:39:21 -0700 Subject: [PATCH] Fix immediate bridge reload Currently bridge connections will backoff even when set to immediate. This change makes the first attempt to reconnect happen without wait. On failure, backoff will apply as usual. Signed-off-by: Abilio Marques --- src/bridge.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/bridge.c b/src/bridge.c index 149c4cf87b..3800c0cd9b 100644 --- a/src/bridge.c +++ b/src/bridge.c @@ -733,6 +733,7 @@ int bridge__register_local_connections(void) void bridge__reload(void) { + struct mosquitto *context; int i; int j; @@ -768,7 +769,8 @@ void bridge__reload(void) assert(jwill_delay_interval = 0; bridge__destroy(db.bridges[j]); - bridge__new(db.config->bridges[i]); + context = bridge__new(db.config->bridges[i]); + context->bridge->restart_t = 1; /* force quick restart of bridge */ db.config->bridges[i] = NULL; } }