mirror of
https://github.com/meilisearch/MeiliSearch
synced 2025-07-04 20:37:15 +02:00
format code
This commit is contained in:
parent
1f16c8d224
commit
4041d9dc48
18 changed files with 60 additions and 61 deletions
|
@ -39,7 +39,10 @@ where
|
|||
}
|
||||
|
||||
pub async fn run(self) {
|
||||
info!("Snashot scheduled every {}s.", self.snapshot_period.as_secs());
|
||||
info!(
|
||||
"Snashot scheduled every {}s.",
|
||||
self.snapshot_period.as_secs()
|
||||
);
|
||||
loop {
|
||||
sleep(self.snapshot_period).await;
|
||||
if let Err(e) = self.perform_snapshot().await {
|
||||
|
@ -49,17 +52,11 @@ where
|
|||
}
|
||||
|
||||
async fn perform_snapshot(&self) -> anyhow::Result<()> {
|
||||
if !self.snapshot_path.is_file() {
|
||||
bail!("Invalid snapshot file path.");
|
||||
}
|
||||
|
||||
info!("Performing snapshot.");
|
||||
|
||||
let temp_snapshot_dir = spawn_blocking(move || tempfile::tempdir_in(".")).await??;
|
||||
let temp_snapshot_path = temp_snapshot_dir.path().to_owned();
|
||||
|
||||
fs::create_dir_all(&temp_snapshot_path).await?;
|
||||
|
||||
let uuids = self
|
||||
.uuid_resolver_handle
|
||||
.snapshot(temp_snapshot_path.clone())
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue