Merge branch 'lmdb_update' into grim

This commit is contained in:
ardocrat
2026-04-24 18:26:02 +03:00
+9 -6
View File
@@ -322,12 +322,15 @@ impl Store {
}
debug!("Start resizing {} DB", self.name);
unsafe {
let batches_count =
ENV_BATCHES_COUNT.get_or_init(|| Arc::new(RwLock::new(HashMap::new())));
let batches = batches_count.write();
let cur = batches.get(&self.env_path).unwrap_or(&0);
debug!("Wait {} batches to complete", cur);
while cur != &0 {
loop {
let batches_count =
ENV_BATCHES_COUNT.get_or_init(|| Arc::new(RwLock::new(HashMap::new())));
let batches = batches_count.read();
let cur = batches.get(&self.env_path).unwrap_or(&0);
if cur == &0 {
break;
}
debug!("Wait {} batches to complete", cur);
thread::sleep(Duration::from_millis(100));
}
self.env.resize(new_size)?;