Create lmdb subdir if missing

This commit is contained in:
Mike Dilger 2024-04-25 10:47:06 +12:00
parent 38a20d0a78
commit d70d4b0852

View File

@ -24,6 +24,10 @@ impl Store {
/// Setup persistent storage
pub fn new(config: &Config) -> Result<Store, Error> {
let dir = format!("{}/lmdb", &config.data_directory);
// Create the lmdb subdir if it doesn't exist, ignoring errors
let _ = std::fs::create_dir(&dir);
let lmdb = Lmdb::new(&dir)?;
let events_are_aligned = lmdb.get_if_events_are_aligned()?;