Add EventsWorker to worker module: Introduced EventsWorker for handling event-related tasks. Updated main.rs to include EventsWorker in the worker creation process. Adjusted WeatherWorker instantiation to use cloned pool and broker for consistency.
This commit is contained in:
@@ -13,9 +13,9 @@ use libsystemd::daemon::{self, NotifyState};
|
||||
use message_broker::MessageBroker;
|
||||
use websocket_server::WebSocketServer;
|
||||
use worker::{
|
||||
CharacterCreationWorker, ConnectionPool, DirectorWorker, HouseWorker, PoliticsWorker,
|
||||
ProduceWorker, StockageManager, TransportWorker, UndergroundWorker, UserCharacterWorker,
|
||||
ValueRecalculationWorker, WeatherWorker, Worker,
|
||||
CharacterCreationWorker, ConnectionPool, DirectorWorker, EventsWorker, HouseWorker,
|
||||
PoliticsWorker, ProduceWorker, StockageManager, TransportWorker, UndergroundWorker,
|
||||
UserCharacterWorker, ValueRecalculationWorker, WeatherWorker, Worker,
|
||||
};
|
||||
|
||||
static KEEP_RUNNING: AtomicBool = AtomicBool::new(true);
|
||||
@@ -141,7 +141,8 @@ fn create_workers(pool: ConnectionPool, broker: MessageBroker) -> Vec<Box<dyn Wo
|
||||
Box::new(PoliticsWorker::new(pool.clone(), broker.clone())),
|
||||
Box::new(TransportWorker::new(pool.clone(), broker.clone())),
|
||||
Box::new(UndergroundWorker::new(pool.clone(), broker.clone())),
|
||||
Box::new(WeatherWorker::new(pool, broker)),
|
||||
Box::new(WeatherWorker::new(pool.clone(), broker.clone())),
|
||||
Box::new(EventsWorker::new(pool, broker)),
|
||||
]
|
||||
}
|
||||
|
||||
|
||||
1810
src/worker/events.rs
Normal file
1810
src/worker/events.rs
Normal file
File diff suppressed because it is too large
Load Diff
@@ -10,6 +10,7 @@ mod value_recalculation;
|
||||
mod user_character;
|
||||
mod transport;
|
||||
mod weather;
|
||||
mod events;
|
||||
|
||||
pub use base::Worker;
|
||||
pub use crate::db::ConnectionPool;
|
||||
@@ -24,4 +25,5 @@ pub use value_recalculation::ValueRecalculationWorker;
|
||||
pub use user_character::UserCharacterWorker;
|
||||
pub use transport::TransportWorker;
|
||||
pub use weather::WeatherWorker;
|
||||
pub use events::EventsWorker;
|
||||
|
||||
|
||||
@@ -290,7 +290,7 @@ const QUERY_GET_PREGNANCY_CANDIDATES: &str = r#"
|
||||
+ (CURRENT_DATE - c2.birthdate::date)) / 2
|
||||
) - 2.638267
|
||||
))
|
||||
) / 2;
|
||||
);
|
||||
"#;
|
||||
|
||||
const QUERY_INSERT_CHILD: &str = r#"
|
||||
|
||||
Reference in New Issue
Block a user