New pubsub backend.

This commit is contained in:
Paul Makles
2020-09-03 16:26:32 +01:00
parent c95dc19f67
commit c3362a6e4f
19 changed files with 581 additions and 56 deletions

View File

@@ -11,33 +11,38 @@ extern crate lazy_static;
pub mod database;
pub mod notifications;
pub mod pubsub;
pub mod routes;
pub mod util;
use log::info;
use rocket_cors::AllowedOrigins;
use std::thread;
use log::info;
fn main() {
dotenv::dotenv().ok();
env_logger::init_from_env(
env_logger::Env::default()
.filter_or("RUST_LOG", "info")
);
env_logger::init_from_env(env_logger::Env::default().filter_or("RUST_LOG", "info"));
info!("Starting REVOLT server.");
util::variables::preflight_checks();
database::connect();
// ! START OLD NOTIF CODE
notifications::start_worker();
thread::spawn(|| {
notifications::pubsub::launch_subscriber();
});
thread::spawn(|| {
notifications::state::init();
/*thread::spawn(|| {
notifications::ws::launch_server();
});
});*/
// ! END OLD NOTIF CODE
pubsub::hive::init_hive();
pubsub::websocket::launch_server();
let cors = rocket_cors::CorsOptions {
allowed_origins: AllowedOrigins::All,