this repo has no description
0
fork

Configure Feed

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

fix: Remove unused and

+5 -26
+4 -26
server/src/helpers/events.rs
··· 24 24 */ 25 25 26 26 use crate::LuminaError; 27 - use crate::database::{DatabaseConnections, DbConn, PgConn}; 27 + use crate::database::{DatabaseConnections, PgConn}; 28 28 use cynthia_con::{CynthiaColors, CynthiaStyles}; 29 29 use time::OffsetDateTime; 30 30 ··· 48 48 /// and, when available, also logs entries into the database. 49 49 /// 50 50 /// The database log entry is simple, with the log type, the message, and a timestamp. 51 - pub enum EventLogger { 51 + pub(crate) enum EventLogger { 52 52 /// Variant created when logger has a database, and the database nor environment have any settings blocking database logging. 53 53 WithDatabase(Box<PgConn>), 54 54 /// Only log to stdout ··· 63 63 match db { 64 64 Some(d) => Self::from_db(d).await, 65 65 None => Self::OnlyStdout, 66 - } 67 - } 68 - pub async fn new_l(db: &Option<DbConn>) -> Self { 69 - // For quick implementation we'll just check if not none and that's all. 70 - match db { 71 - Some(d) => Self::from_db_l(d).await, 72 - None => Self::OnlyStdout, 73 - } 74 - } 75 - 76 - pub async fn from_db_l(db_: &DbConn) -> Self { 77 - match db_.recreate().await { 78 - Ok(db) => { 79 - let new_db = DbConn::to_pgconn(db); 80 - Self::WithDatabase(Box::new(new_db)) 81 - } 82 - Err(error) => { 83 - let n = Self::OnlyStdout; 84 - n.error( 85 - format!("Could not connect the logger to the database! {:?}", error).as_str(), 86 - ) 87 - .await; 88 - n 89 - } 90 66 } 91 67 } 92 68 ··· 243 219 } 244 220 245 221 /// Convenience method to log a failure message. 222 + #[allow(unused)] 246 223 pub async fn failure(&self, message: &str) { 247 224 self.log(EventType::Failure, message).await 248 225 } 249 226 250 227 /// Convenience method to log a plain message without a specific log level. 228 + #[allow(unused)] 251 229 pub async fn log_plain(&self, message: &str) { 252 230 self.log(EventType::Log, message).await 253 231 }
+1
server/src/main.rs
··· 42 42 use tokio_postgres as postgres; 43 43 struct AppState(Arc<InnerAppState>); 44 44 struct InnerAppState { 45 + #[allow(dead_code)] 45 46 config: ServerConfig, 46 47 db: Mutex<DbConn>, 47 48 event_logger: EventLogger,