fix bug and add tests

- add tests about updates
- fix select bug

fix #896
This commit is contained in:
many 2020-07-13 18:22:18 +02:00
parent cb267b68ed
commit 94b3e8e56e
No known key found for this signature in database
GPG key ID: 2CEF23B75189EACA
5 changed files with 206 additions and 30 deletions

View file

@ -70,7 +70,7 @@ async fn main() -> Result<(), MainError> {
}));
if let Some(path) = &opt.snapshot_path {
snapshot::schedule_snapshot(data.clone(), &path, opt.snapshot_interval_sec)?;
snapshot::schedule_snapshot(data.clone(), &path, opt.snapshot_interval_sec.unwrap_or(86400))?;
}
print_launch_resume(&opt, &data);

View file

@ -113,8 +113,8 @@ pub struct Opt {
pub snapshot_path: Option<PathBuf>,
/// Defines time interval, in seconds, between each snapshot creation.
#[structopt(long, requires = "snapshot-path", default_value = "86400", env = "MEILI_SNAPSHOT_INTERVAL_SEC")]
pub snapshot_interval_sec: u64,
#[structopt(long, requires = "snapshot-path", env = "MEILI_SNAPSHOT_INTERVAL_SEC")]
pub snapshot_interval_sec: Option<u64>,
}
impl Opt {