mirror of
https://github.com/meilisearch/meilisearch.git
synced 2024-11-27 04:25:06 +08: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)
|
.timestamp(stderrlog::Timestamp::Off)
|
||||||
.init()?;
|
.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();
|
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);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user