this repo has no description
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

Insert ev_log into the appstate

+5 -6
+3 -4
server/src/client_communication.rs
··· 1 1 use crate::user::User; 2 2 use crate::{ 3 - AppState, LuminaError, error_elog, helpers, incoming_elog, info_elog, registration_error_elog, 3 + AppState, LuminaError, error_elog, incoming_elog, info_elog, registration_error_elog, 4 4 warn_elog, 5 5 }; 6 6 use cynthia_con::{CynthiaColors, CynthiaStyles}; ··· 19 19 user: None, 20 20 }; 21 21 let ev_log = { 22 - let appstate = state.0.clone(); 23 - let db = &appstate.1.lock().await; 24 - helpers::events::EventLogger::from_db(db).await 22 + let appstate = state.0.clone(); 23 + appstate.2.clone().await 25 24 }; 26 25 while let Some(message) = stream.next().await { 27 26 match message? {
+2 -2
server/src/main.rs
··· 17 17 use tokio::sync::Mutex; 18 18 mod user; 19 19 use tokio_postgres as postgres; 20 - struct AppState(Arc<(ServerConfig, Mutex<DbConn>)>); 20 + struct AppState(Arc<(ServerConfig, Mutex<DbConn>, EventLogger)>); 21 21 22 22 use database::DbConn; 23 23 ··· 134 134 let ev_log = EventLogger::new(&db_mut).await; 135 135 let db = db_mut.unwrap(); 136 136 137 - let appstate = AppState(Arc::from((config.clone(), Mutex::from(db)))); 137 + let appstate = AppState(Arc::from((config.clone(), Mutex::from(db), ev_log.clone().await))); 138 138 139 139 let def = rocket::Config { 140 140 port: config.port,