mirror of
https://github.com/meilisearch/MeiliSearch
synced 2024-11-26 23:04:26 +01:00
Avoid creating a default empty database in the infos crate
This commit is contained in:
parent
794fce7bff
commit
45330a5e47
@ -200,6 +200,11 @@ fn run(opt: Opt) -> anyhow::Result<()> {
|
|||||||
let mut options = EnvOpenOptions::new();
|
let mut options = EnvOpenOptions::new();
|
||||||
options.map_size(opt.database_size.get_bytes() as usize);
|
options.map_size(opt.database_size.get_bytes() as usize);
|
||||||
|
|
||||||
|
// Return an error if the database does not exist.
|
||||||
|
if !opt.database.exists() {
|
||||||
|
anyhow::bail!("The database ({}) does not exist.", opt.database.display());
|
||||||
|
}
|
||||||
|
|
||||||
// Open the LMDB database.
|
// Open the LMDB database.
|
||||||
let index = Index::new(options, opt.database)?;
|
let index = Index::new(options, opt.database)?;
|
||||||
let rtxn = index.read_txn()?;
|
let rtxn = index.read_txn()?;
|
||||||
|
Loading…
Reference in New Issue
Block a user