2022-11-09 19:03:03 +01:00
|
|
|
use cave::{
|
|
|
|
config::LoadConfig,
|
2022-11-16 19:12:25 +01:00
|
|
|
firehose::FirehoseFactory,
|
2022-11-15 00:45:02 +01:00
|
|
|
};
|
2022-11-05 20:51:18 +01:00
|
|
|
|
|
|
|
mod config;
|
2022-11-05 20:04:31 +01:00
|
|
|
mod trends;
|
2022-11-06 01:29:58 +01:00
|
|
|
mod html_template;
|
|
|
|
mod http_server;
|
2022-11-05 20:04:31 +01:00
|
|
|
|
|
|
|
#[tokio::main]
|
|
|
|
async fn main() {
|
2022-11-05 20:51:18 +01:00
|
|
|
cave::init::exit_on_panic();
|
2022-12-01 01:39:38 +01:00
|
|
|
cave::init::init_logger(5556);
|
2022-11-05 20:51:18 +01:00
|
|
|
|
|
|
|
let config = config::Config::load();
|
|
|
|
|
|
|
|
cave::systemd::status("Starting redis client");
|
2022-11-15 00:45:02 +01:00
|
|
|
let store = cave::store::Store::new(8, config.redis.clone()).await;
|
|
|
|
|
|
|
|
let firehose_factory = FirehoseFactory::new(config.redis);
|
2022-11-05 20:51:18 +01:00
|
|
|
|
2022-11-10 03:27:50 +01:00
|
|
|
let http = http_server::start(
|
2022-11-09 19:03:03 +01:00
|
|
|
config.listen_port,
|
2022-12-30 01:56:20 +01:00
|
|
|
store,
|
2022-11-15 00:45:02 +01:00
|
|
|
firehose_factory,
|
2022-11-10 03:27:50 +01:00
|
|
|
);
|
|
|
|
cave::systemd::ready();
|
|
|
|
http.await;
|
2022-11-05 20:04:31 +01:00
|
|
|
}
|