Add leftover bridges to bridgedb

This commit is contained in:
onyinyang 2023-05-08 20:30:30 -04:00
parent bc7f7f8e81
commit 6b52e7f5a3
No known key found for this signature in database
GPG Key ID: 156A6435430C2036
2 changed files with 10 additions and 0 deletions

View File

@ -100,6 +100,15 @@ impl LoxServerContext {
} }
pub fn allocate_leftover_bridges(&self) {
let mut ba_obj = self.ba.lock().unwrap();
let mut db_obj = self.db.lock().unwrap();
let mut extra_bridges = self.extra_bridges.lock().unwrap();
ba_obj.allocate_bridges(&mut extra_bridges, &mut db_obj);
}
pub fn add_openinv_bucket(&self, bucket: [BridgeLine; 3]) { pub fn add_openinv_bucket(&self, bucket: [BridgeLine; 3]) {
let mut ba_obj = self.ba.lock().unwrap(); let mut ba_obj = self.ba.lock().unwrap();
let mut db_obj = self.db.lock().unwrap(); let mut db_obj = self.db.lock().unwrap();

View File

@ -354,6 +354,7 @@ async fn context_manager(mut context_rx: mpsc::Receiver<Command>) {
} }
} }
} }
context.allocate_leftover_bridges();
context.encrypt_table(); context.encrypt_table();
sleep(Duration::from_millis(1)).await; sleep(Duration::from_millis(1)).await;
} }