From 10dace305d7721d4d40a6de8539770a9a03f2828 Mon Sep 17 00:00:00 2001 From: many Date: Thu, 15 Oct 2020 16:11:02 +0200 Subject: [PATCH] snapshot at start --- meilisearch-http/src/snapshot.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/meilisearch-http/src/snapshot.rs b/meilisearch-http/src/snapshot.rs index 0351aa26f..520044f84 100644 --- a/meilisearch-http/src/snapshot.rs +++ b/meilisearch-http/src/snapshot.rs @@ -45,10 +45,10 @@ pub fn schedule_snapshot(data: Data, snapshot_dir: &Path, time_gap_s: u64) -> Re let snapshot_path = snapshot_dir.join(format!("{}.snapshot", db_name.to_str().unwrap_or("data.ms"))); thread::spawn(move || loop { - thread::sleep(Duration::from_secs(time_gap_s)); if let Err(e) = create_snapshot(&data, &snapshot_path) { error!("Unsuccessful snapshot creation: {}", e); } + thread::sleep(Duration::from_secs(time_gap_s)); }); Ok(())