Add new bridges when first populated

This commit is contained in:
onyinyang 2023-10-26 13:22:19 -04:00
parent b1d8ce7d8f
commit 9ac2df642a
No known key found for this signature in database
GPG Key ID: 156A6435430C2036
2 changed files with 4 additions and 2 deletions

View File

@ -173,14 +173,15 @@ impl LoxServerContext {
match self.replace_with_new(bridgeline) {
lox_library::ReplaceSuccess::Replaced => {
println!("BridgeLine {:?} not found in rdsys update was successfully replaced.", bridgeline.uid_fingerprint);
self.metrics.removed_bridges.inc();}
self.metrics.removed_bridges.inc();
}
lox_library::ReplaceSuccess::NotReplaced => {
// Add the bridge to the list of to_be_replaced bridges in the Lox context and try
// again to replace at the next update (nothing changes in the Lox Authority)
println!("BridgeLine {:?} not found in rdsys update NOT replaced, saved for next update!",
bridgeline.uid_fingerprint);
self.new_to_be_replaced_bridge(bridgeline);
self.metrics.existing_or_updated_bridges.inc();
self.metrics.existing_or_updated_bridges.inc();
}
lox_library::ReplaceSuccess::NotFound => println!(
"BridgeLine {:?} no longer in reachable bridges.",

View File

@ -204,6 +204,7 @@ async fn context_manager(
if context.bridgetable_is_empty() {
if let Some(working_resources) = resources.working {
let bridgelines = parse_into_bridgelines(working_resources);
context.metrics.new_bridges.inc_by(bridgelines.len() as u64);
let (buckets, leftovers) = parse_into_buckets(bridgelines);
for leftover in leftovers {
context.append_extra_bridges(leftover);