oops
This commit is contained in:
parent
4f3912a020
commit
f0787fa3a8
@ -27,86 +27,86 @@ extern crate cookie;
|
|||||||
extern crate tungstenite;
|
extern crate tungstenite;
|
||||||
extern crate crossbeam_channel;
|
extern crate crossbeam_channel;
|
||||||
|
|
||||||
// mod account;
|
mod account;
|
||||||
// mod construct;
|
mod construct;
|
||||||
// mod effect;
|
mod effect;
|
||||||
// mod game;
|
mod game;
|
||||||
// mod instance;
|
mod instance;
|
||||||
// mod item;
|
mod item;
|
||||||
mod img;
|
mod img;
|
||||||
// mod mob;
|
mod mob;
|
||||||
// mod mtx;
|
mod mtx;
|
||||||
// mod names;
|
mod names;
|
||||||
// mod net;
|
mod net;
|
||||||
// mod payments;
|
mod payments;
|
||||||
// mod pg;
|
mod pg;
|
||||||
// mod player;
|
mod player;
|
||||||
// mod pubsub;
|
mod pubsub;
|
||||||
// mod rpc;
|
mod rpc;
|
||||||
// mod skill;
|
mod skill;
|
||||||
// mod spec;
|
mod spec;
|
||||||
// mod util;
|
mod util;
|
||||||
// mod vbox;
|
mod vbox;
|
||||||
// mod warden;
|
mod warden;
|
||||||
// mod ws;
|
mod ws;
|
||||||
|
|
||||||
// use std::thread::{sleep, spawn};
|
use std::thread::{sleep, spawn};
|
||||||
// use std::time::{Duration};
|
use std::time::{Duration};
|
||||||
// use dotenv::dotenv;
|
use dotenv::dotenv;
|
||||||
|
|
||||||
// use pubsub::pg_listen;
|
use pubsub::pg_listen;
|
||||||
// use warden::warden;
|
use warden::warden;
|
||||||
|
|
||||||
// fn setup_logger() -> Result<(), fern::InitError> {
|
fn setup_logger() -> Result<(), fern::InitError> {
|
||||||
// fern::Dispatch::new()
|
fern::Dispatch::new()
|
||||||
// .format(|out, message, record| {
|
.format(|out, message, record| {
|
||||||
// out.finish(format_args!(
|
out.finish(format_args!(
|
||||||
// "{}[{}][{}] {}",
|
"{}[{}][{}] {}",
|
||||||
// chrono::Local::now().format("[%Y-%m-%d][%H:%M:%S]"),
|
chrono::Local::now().format("[%Y-%m-%d][%H:%M:%S]"),
|
||||||
// record.target(),
|
record.target(),
|
||||||
// record.level(),
|
record.level(),
|
||||||
// message
|
message
|
||||||
// ))
|
))
|
||||||
// })
|
})
|
||||||
// .level_for("postgres", log::LevelFilter::Info)
|
.level_for("postgres", log::LevelFilter::Info)
|
||||||
// .level_for("iron", log::LevelFilter::Info)
|
.level_for("iron", log::LevelFilter::Info)
|
||||||
// .level(log::LevelFilter::Info)
|
.level(log::LevelFilter::Info)
|
||||||
// .chain(std::io::stdout())
|
.chain(std::io::stdout())
|
||||||
// .chain(fern::log_file("/var/log/mnml/mnml.log")?)
|
.chain(fern::log_file("/var/log/mnml/mnml.log")?)
|
||||||
// .apply()?;
|
.apply()?;
|
||||||
// Ok(())
|
Ok(())
|
||||||
// }
|
}
|
||||||
|
|
||||||
// fn main() {
|
fn main() {
|
||||||
// dotenv().ok();
|
dotenv().ok();
|
||||||
// setup_logger().unwrap();
|
setup_logger().unwrap();
|
||||||
|
|
||||||
// let pool = pg::create_pool();
|
let pool = pg::create_pool();
|
||||||
|
|
||||||
// let ws_pool = pool.clone();
|
let ws_pool = pool.clone();
|
||||||
// let http_pool = pool.clone();
|
let http_pool = pool.clone();
|
||||||
// let warden_pool = pool.clone();
|
let warden_pool = pool.clone();
|
||||||
// let pubsub_pool = pool.clone();
|
let pubsub_pool = pool.clone();
|
||||||
|
|
||||||
// spawn(move || {
|
spawn(move || {
|
||||||
// loop {
|
loop {
|
||||||
// let db_connection = warden_pool.get().expect("unable to get db connection");
|
let db_connection = warden_pool.get().expect("unable to get db connection");
|
||||||
// if let Err(e) = warden(db_connection) {
|
if let Err(e) = warden(db_connection) {
|
||||||
// info!("{:?}", e);
|
info!("{:?}", e);
|
||||||
// }
|
}
|
||||||
// sleep(Duration::new(1, 0));
|
sleep(Duration::new(1, 0));
|
||||||
// }
|
}
|
||||||
// });
|
});
|
||||||
|
|
||||||
// spawn(move || loop {
|
spawn(move || loop {
|
||||||
// let pubsub_conn = pubsub_pool.get().expect("could not get pubsub pg connection");
|
let pubsub_conn = pubsub_pool.get().expect("could not get pubsub pg connection");
|
||||||
// match pg_listen(pubsub_conn) {
|
match pg_listen(pubsub_conn) {
|
||||||
// Ok(_) => warn!("pg listen closed"),
|
Ok(_) => warn!("pg listen closed"),
|
||||||
// Err(e) => warn!("pg_listen error {:?}", e),
|
Err(e) => warn!("pg_listen error {:?}", e),
|
||||||
// }
|
}
|
||||||
// });
|
});
|
||||||
|
|
||||||
// spawn(move || net::start(http_pool));
|
spawn(move || net::start(http_pool));
|
||||||
// ws::start(ws_pool);
|
ws::start(ws_pool);
|
||||||
// info!("server started");
|
info!("server started");
|
||||||
// }
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user