add ActorSystem member to PlumeRocket

pull/813/head
Mina Galić 4年前
コミット 94cf4dab98
署名者: igalic
GPGキーID: ACFEFF7F6A123A86

@ -17,6 +17,8 @@ extern crate serde_json;
#[macro_use]
extern crate tantivy;
extern crate riker;
use plume_common::activity_pub::inbox::InboxError;
#[cfg(not(any(feature = "sqlite", feature = "postgres")))]

@ -3,6 +3,7 @@ pub use self::module::PlumeRocket;
#[cfg(not(test))]
mod module {
use crate::{db_conn::DbConn, search, users};
use riker::actors::ActorSystem;
use rocket::{
request::{self, FlashMessage, FromRequest, Request},
Outcome, State,
@ -18,6 +19,7 @@ mod module {
pub searcher: Arc<search::Searcher>,
pub worker: Arc<ScheduledThreadPool>,
pub flash_msg: Option<(String, String)>,
pub actors: Arc<ActorSystem>,
}
impl<'a, 'r> FromRequest<'a, 'r> for PlumeRocket {
@ -30,6 +32,7 @@ mod module {
let worker = request.guard::<'_, State<'_, Arc<ScheduledThreadPool>>>()?;
let searcher = request.guard::<'_, State<'_, Arc<search::Searcher>>>()?;
let flash_msg = request.guard::<FlashMessage<'_, '_>>().succeeded();
let actors = request.guard::<'_, State<'_, Arc<ActorSystem>>>()?;
Outcome::Success(PlumeRocket {
conn,
intl,
@ -37,6 +40,7 @@ mod module {
flash_msg: flash_msg.map(|f| (f.name().into(), f.msg().into())),
worker: worker.clone(),
searcher: searcher.clone(),
actors: actors.clone(),
})
}
}

@ -235,6 +235,7 @@ Then try to restart Plume.
.manage(dbpool)
.manage(Arc::new(workpool))
.manage(searcher)
.manage(Arc::new(sys))
.manage(include_i18n!())
.attach(
CsrfFairingBuilder::new()

読み込み中…
キャンセル
保存