Initialize SearchActor at start

This commit is contained in:
Kitaiti Makoto 2021-01-07 04:56:35 +09:00
parent 1bfed0294f
commit e18be6ec95

View File

@ -16,7 +16,7 @@ use plume_models::{
db_conn::{DbPool, PragmaForeignKey}, db_conn::{DbPool, PragmaForeignKey},
instance::Instance, instance::Instance,
migrations::IMPORTED_MIGRATIONS, migrations::IMPORTED_MIGRATIONS,
search::Searcher as UnmanagedSearcher, search::{actor::SearchActor, Searcher as UnmanagedSearcher},
Connection, CONFIG, Connection, CONFIG,
}; };
use rocket_csrf::CsrfFairingBuilder; use rocket_csrf::CsrfFairingBuilder;
@ -104,6 +104,7 @@ Then try to restart Plume.
&CONFIG.search_index, &CONFIG.search_index,
&CONFIG.search_tokenizers, &CONFIG.search_tokenizers,
)); ));
SearchActor::init(searcher.clone(), dbpool.clone());
let commiter = searcher.clone(); let commiter = searcher.clone();
workpool.execute_with_fixed_delay( workpool.execute_with_fixed_delay(
Duration::from_secs(5), Duration::from_secs(5),