mirror of
https://github.com/meilisearch/meilisearch.git
synced 2024-11-30 00:55:00 +08:00
fix blocking auth controller dump
This commit is contained in:
parent
cbd27d313c
commit
108b3520de
@ -16,7 +16,8 @@ pub fn generate_uid() -> String {
|
|||||||
}
|
}
|
||||||
|
|
||||||
mod real {
|
mod real {
|
||||||
use std::{fs::File, path::PathBuf, sync::Arc};
|
use std::path::PathBuf;
|
||||||
|
use std::sync::Arc;
|
||||||
|
|
||||||
use log::{info, trace};
|
use log::{info, trace};
|
||||||
use meilisearch_auth::AuthController;
|
use meilisearch_auth::AuthController;
|
||||||
@ -88,8 +89,13 @@ mod real {
|
|||||||
|
|
||||||
create_dir_all(&temp_dump_path.join("indexes")).await?;
|
create_dir_all(&temp_dump_path.join("indexes")).await?;
|
||||||
|
|
||||||
// TODO: this is blocking!!
|
let db_path = self.db_path.clone();
|
||||||
AuthController::dump(&self.db_path, &temp_dump_path)?;
|
let temp_dump_path_clone = temp_dump_path.clone();
|
||||||
|
tokio::task::spawn_blocking(move || -> Result<()> {
|
||||||
|
AuthController::dump(db_path, temp_dump_path_clone)?;
|
||||||
|
Ok(())
|
||||||
|
})
|
||||||
|
.await??;
|
||||||
TaskStore::dump(
|
TaskStore::dump(
|
||||||
self.env.clone(),
|
self.env.clone(),
|
||||||
&temp_dump_path,
|
&temp_dump_path,
|
||||||
|
Loading…
Reference in New Issue
Block a user