2738: Add missing env vars for dumps and snapshots features r=irevoire a=gmourier

# Pull Request

## What does this PR do?
Fixes #2721


## PR checklist
Please check if your PR fulfills the following requirements:
- [x] Does this PR fix an existing issue?
- [x] Have you read the contributing guidelines?
- [x] Have you made sure that the title is accurate and descriptive of the changes?

Thank you so much for contributing to Meilisearch!


Co-authored-by: Guillaume Mourier <guillaume@meilisearch.com>
This commit is contained in:
bors[bot] 2022-09-05 11:12:09 +00:00 committed by GitHub
commit 2d34b239ab
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -103,15 +103,23 @@ pub struct Opt {
/// Defines the path of the snapshot file to import. /// Defines the path of the snapshot file to import.
/// This option will, by default, stop the process if a database already exist or if no snapshot exists at /// This option will, by default, stop the process if a database already exist or if no snapshot exists at
/// the given path. If this option is not specified no snapshot is imported. /// the given path. If this option is not specified no snapshot is imported.
#[clap(long)] #[clap(long, env = "MEILI_IMPORT_SNAPSHOT")]
pub import_snapshot: Option<PathBuf>, pub import_snapshot: Option<PathBuf>,
/// The engine will ignore a missing snapshot and not return an error in such case. /// The engine will ignore a missing snapshot and not return an error in such case.
#[clap(long, requires = "import-snapshot")] #[clap(
long,
env = "MEILI_IGNORE_MISSING_SNAPSHOT",
requires = "import-snapshot"
)]
pub ignore_missing_snapshot: bool, pub ignore_missing_snapshot: bool,
/// The engine will skip snapshot importation and not return an error in such case. /// The engine will skip snapshot importation and not return an error in such case.
#[clap(long, requires = "import-snapshot")] #[clap(
long,
env = "MEILI_IGNORE_SNAPSHOT_IF_DB_EXISTS",
requires = "import-snapshot"
)]
pub ignore_snapshot_if_db_exists: bool, pub ignore_snapshot_if_db_exists: bool,
/// Defines the directory path where meilisearch will create snapshot each snapshot_time_gap. /// Defines the directory path where meilisearch will create snapshot each snapshot_time_gap.
@ -127,15 +135,15 @@ pub struct Opt {
pub snapshot_interval_sec: u64, pub snapshot_interval_sec: u64,
/// Import a dump from the specified path, must be a `.dump` file. /// Import a dump from the specified path, must be a `.dump` file.
#[clap(long, conflicts_with = "import-snapshot")] #[clap(long, env = "MEILI_IMPORT_DUMP", conflicts_with = "import-snapshot")]
pub import_dump: Option<PathBuf>, pub import_dump: Option<PathBuf>,
/// If the dump doesn't exists, load or create the database specified by `db-path` instead. /// If the dump doesn't exists, load or create the database specified by `db-path` instead.
#[clap(long, requires = "import-dump")] #[clap(long, env = "MEILI_IGNORE_MISSING_DUMP", requires = "import-dump")]
pub ignore_missing_dump: bool, pub ignore_missing_dump: bool,
/// Ignore the dump if a database already exists, and load that database instead. /// Ignore the dump if a database already exists, and load that database instead.
#[clap(long, requires = "import-dump")] #[clap(long, env = "MEILI_IGNORE_DUMP_IF_DB_EXISTS", requires = "import-dump")]
pub ignore_dump_if_db_exists: bool, pub ignore_dump_if_db_exists: bool,
/// Folder where dumps are created when the dump route is called. /// Folder where dumps are created when the dump route is called.