Skip to content

Commit

Permalink
Fix immediate bridge reload
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
abiliojr committed Oct 18, 2023
1 parent 279bd33 commit ca8a139
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/bridge.c
Original file line number Diff line number Diff line change
Expand Up @@ -736,6 +736,7 @@ int bridge__register_local_connections(void)

void bridge__reload(void)
{
struct mosquitto *context;
int i;
int j;

Expand Down Expand Up @@ -771,7 +772,8 @@ void bridge__reload(void)
assert(j<db.bridge_count);
db.bridges[j]->will_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;
}
}
Expand Down

0 comments on commit ca8a139

Please sign in to comment.