aob-lemmy-bot/src/main.rs

30 lines
713 B
Rust

use chrono::{Duration};
use log::{LevelFilter};
use once_cell::sync::Lazy;
use reqwest::Client;
use std::fmt::Debug;
use systemd_journal_logger::{JournalLog};
mod bot;
mod config;
mod lemmy;
mod post_history;
mod fetchers;
pub static HTTP_CLIENT: Lazy<Client> = Lazy::new(|| {
Client::builder()
.timeout(Duration::seconds(30).to_std().unwrap())
.connect_timeout(Duration::seconds(30).to_std().unwrap())
.build()
.expect("build client")
});
#[tokio::main]
async fn main() {
JournalLog::new()
.expect("Systemd-Logger crate error")
.install()
.expect("Systemd-Logger crate error");
log::set_max_level(LevelFilter::Info);
bot::run().await;
}