Delay recycling bridge table keys until we're done with them
This commit is contained in:
parent
6462027b7f
commit
41402209f5
|
@ -574,7 +574,6 @@ impl BridgeAuth {
|
||||||
return ReplaceSuccess::NotReplaced;
|
return ReplaceSuccess::NotReplaced;
|
||||||
};
|
};
|
||||||
self.bridge_table.spares.remove(&spare);
|
self.bridge_table.spares.remove(&spare);
|
||||||
self.bridge_table.recycleable_keys.push(spare);
|
|
||||||
// Get the actual bridges from the spare bucket
|
// Get the actual bridges from the spare bucket
|
||||||
let spare_bucket = match self.bridge_table.buckets.remove(&spare) {
|
let spare_bucket = match self.bridge_table.buckets.remove(&spare) {
|
||||||
Some(spare_bucket) => spare_bucket,
|
Some(spare_bucket) => spare_bucket,
|
||||||
|
@ -583,6 +582,7 @@ impl BridgeAuth {
|
||||||
};
|
};
|
||||||
// Remove the spare bucket uid from the keys map
|
// Remove the spare bucket uid from the keys map
|
||||||
self.bridge_table.keys.remove(&spare);
|
self.bridge_table.keys.remove(&spare);
|
||||||
|
self.bridge_table.recycleable_keys.push(spare);
|
||||||
let mut replacement: &BridgeLine = &BridgeLine::default();
|
let mut replacement: &BridgeLine = &BridgeLine::default();
|
||||||
// Make the first spare the replacement bridge, add the others to the set of
|
// Make the first spare the replacement bridge, add the others to the set of
|
||||||
// unallocated_bridges
|
// unallocated_bridges
|
||||||
|
|
Loading…
Reference in New Issue