This commit is contained in:
Louis Dureuil
2023-01-19 10:14:21 +01:00
parent 52bf260f73
commit 06fa22203b

View File

@ -61,6 +61,9 @@ pub struct IndexMapper {
}
mod index_map {
/// the map size to use when we don't succeed in reading it in indexes.
const DEFAULT_MAP_SIZE: usize = 10_737_418_240; // 10 GiB
use std::collections::BTreeMap;
use std::path::Path;
use std::time::Duration;
@ -259,8 +262,7 @@ mod index_map {
}
fn close(&mut self, uuid: Uuid, index: Index, map_size_growth: usize) {
/// TODO: default map_size
let map_size = index.map_size().unwrap_or_default() + map_size_growth;
let map_size = index.map_size().unwrap_or(DEFAULT_MAP_SIZE) + map_size_growth;
let closing_event = index.prepare_for_closing();
let generation = self.next_generation();
self.unavailable