Delay recycling bridge table keys until we're done with them

This commit is contained in:
Cecylia Bocovich 2024-03-09 17:30:47 -05:00
parent 6462027b7f
commit 41402209f5
No known key found for this signature in database
GPG Key ID: 009DE379FD9B7B90
1 changed files with 1 additions and 1 deletions

View File

@ -574,7 +574,6 @@ impl BridgeAuth {
return ReplaceSuccess::NotReplaced;
};
self.bridge_table.spares.remove(&spare);
self.bridge_table.recycleable_keys.push(spare);
// Get the actual bridges from the spare bucket
let spare_bucket = match self.bridge_table.buckets.remove(&spare) {
Some(spare_bucket) => spare_bucket,
@ -583,6 +582,7 @@ impl BridgeAuth {
};
// Remove the spare bucket uid from the keys map
self.bridge_table.keys.remove(&spare);
self.bridge_table.recycleable_keys.push(spare);
let mut replacement: &BridgeLine = &BridgeLine::default();
// Make the first spare the replacement bridge, add the others to the set of
// unallocated_bridges