Clear extra_bridges in distributor after sync, tidy up print statements

This commit is contained in:
onyinyang 2024-03-12 15:38:19 -04:00
parent 8e08adbdb0
commit dae68efaae
No known key found for this signature in database
GPG Key ID: 156A6435430C2036
1 changed files with 6 additions and 5 deletions

View File

@ -95,6 +95,8 @@ impl LoxServerContext {
self.metrics.new_bridges.inc();
}
}
accounted_for_bridges
}
@ -115,7 +117,7 @@ impl LoxServerContext {
if res {
println!(
"Blocked BridgeLine {:?} successfully marked unreachable",
bridge
bridge.uid_fingerprint
);
self.metrics.blocked_bridges.inc();
} else {
@ -142,7 +144,6 @@ impl LoxServerContext {
// Next, handle the failing bridges. If resource last passed tests >= ACCEPTED_HOURS_OF_FAILURE ago,
// it should be replaced with a working resource and be removed from the bridgetable.
for bridge in failing {
println!("Got here with Resource {:?}", bridge.uid_fingerprint);
let res = self.replace_with_new(bridge);
if res == lox_library::ReplaceSuccess::Replaced {
println!(
@ -237,6 +238,7 @@ impl LoxServerContext {
}
}
}
self.extra_bridges.lock().unwrap().clear();
}
pub fn append_extra_bridges(&self, bridge: BridgeLine) {
@ -803,7 +805,7 @@ mod tests {
);
assert_eq!(
th.context.extra_bridges.lock().unwrap().len(),
expected_extra_bridges,
0,
"Unexpected number of extra bridges"
);
}
@ -838,10 +840,9 @@ mod tests {
);
assert_eq!(
th.context.extra_bridges.lock().unwrap().len(),
expected_extra_bridges,
0,
"Unexpected number of extra bridges"
);
}
}