rename reimport_directory to rescan_vault
parent
05d0fa7a87
commit
6e7cdd9887
|
@ -284,7 +284,7 @@ pub fn resolve_path<C: Connection<Backend = Sqlite>>(
|
|||
Ok(result)
|
||||
}
|
||||
|
||||
pub async fn reimport_directory(
|
||||
pub async fn rescan_vault(
|
||||
pool: DbPool,
|
||||
directory: PathBuf,
|
||||
job_container: Arc<RwLock<JobContainer>>,
|
||||
|
@ -296,8 +296,7 @@ pub async fn reimport_directory(
|
|||
.unwrap();
|
||||
|
||||
let result =
|
||||
actix_web::web::block(move || _reimport_directory(pool, directory, job_container, job_id))
|
||||
.await;
|
||||
actix_web::web::block(move || _rescan_vault(pool, directory, job_container, job_id)).await;
|
||||
if result.is_err() {
|
||||
let err = result.err().unwrap();
|
||||
error!("Update did not succeed! {:?}", err);
|
||||
|
@ -312,7 +311,7 @@ enum UpdatePathOutcome {
|
|||
Removed(PathBuf),
|
||||
}
|
||||
|
||||
fn _reimport_directory<T: AsRef<Path>>(
|
||||
fn _rescan_vault<T: AsRef<Path>>(
|
||||
pool: DbPool,
|
||||
directory: T,
|
||||
job_container: Arc<RwLock<JobContainer>>,
|
||||
|
|
|
@ -110,11 +110,7 @@ fn main() -> Result<()> {
|
|||
|
||||
if !matches.is_present("NO_INITIAL_UPDATE") {
|
||||
info!("Running initial update...");
|
||||
actix::spawn(filesystem::reimport_directory(
|
||||
db_pool,
|
||||
vault_path,
|
||||
job_container,
|
||||
));
|
||||
actix::spawn(filesystem::rescan_vault(db_pool, vault_path, job_container));
|
||||
}
|
||||
|
||||
if !matches.is_present("NO_BROWSER") {
|
||||
|
|
|
@ -169,7 +169,7 @@ pub async fn list_hier(
|
|||
pub async fn api_refresh(state: web::Data<State>) -> Result<HttpResponse, Error> {
|
||||
let _pool = state.db_pool.clone();
|
||||
let _directory = state.directory.clone();
|
||||
actix::spawn(crate::filesystem::reimport_directory(
|
||||
actix::spawn(crate::filesystem::rescan_vault(
|
||||
_pool,
|
||||
_directory,
|
||||
state.job_container.clone(),
|
||||
|
|
Loading…
Reference in New Issue