mirror of
https://github.com/meilisearch/meilisearch.git
synced 2024-11-23 10:37:41 +08: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();
|
||||
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.
|
||||
let index = Index::new(options, opt.database)?;
|
||||
let rtxn = index.read_txn()?;
|
||||
|
Loading…
Reference in New Issue
Block a user