Browse Source

add ActorSystem member to PlumeRocket

pull/813/head
Mina Galić 3 months ago
parent
commit
94cf4dab98
Signed by: igalic <me+github@igalic.co> GPG Key ID: ACFEFF7F6A123A86
3 changed files with 7 additions and 0 deletions
  1. +2
    -0
      plume-models/src/lib.rs
  2. +4
    -0
      plume-models/src/plume_rocket.rs
  3. +1
    -0
      src/main.rs

+ 2
- 0
plume-models/src/lib.rs View File

@@ -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")))]


+ 4
- 0
plume-models/src/plume_rocket.rs View File

@@ -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(),
})
}
}


+ 1
- 0
src/main.rs View File

@@ -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()


Loading…
Cancel
Save