mirror of
https://github.com/meilisearch/MeiliSearch
synced 2024-12-23 21:20:24 +01:00
Avoid creating a default empty database in the search crate
This commit is contained in:
parent
45330a5e47
commit
b59fe77ec7
@ -57,7 +57,11 @@ fn run(opt: Opt) -> anyhow::Result<()> {
|
||||
.timestamp(stderrlog::Timestamp::Off)
|
||||
.init()?;
|
||||
|
||||
std::fs::create_dir_all(&opt.database)?;
|
||||
// Return an error if the database does not exist.
|
||||
if !opt.database.exists() {
|
||||
anyhow::bail!("The database ({}) does not exist.", opt.database.display());
|
||||
}
|
||||
|
||||
let mut options = EnvOpenOptions::new();
|
||||
options.map_size(opt.database_size.get_bytes() as usize);
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user