ptth/src/bin/ptth_relay.rs

24 lines
472 B
Rust
Raw Normal View History

2020-11-02 03:34:50 +00:00
use std::{
error::Error,
2020-11-02 18:39:19 +00:00
sync::Arc,
2020-11-02 03:34:50 +00:00
};
use tracing::{info};
2020-11-02 18:39:19 +00:00
use ptth::relay;
use ptth::relay::RelayState;
#[tokio::main]
async fn main () -> Result <(), Box <dyn Error>> {
tracing_subscriber::fmt::init ();
let config_file = ptth::load_toml::load ("config/ptth_relay.toml");
2020-11-02 03:34:50 +00:00
info! ("ptth_relay Git version: {:?}", ptth::git_version::GIT_VERSION);
2020-11-02 18:39:19 +00:00
relay::run_relay (
Arc::new (RelayState::from (&config_file)),
ptth::graceful_shutdown::init ()
2020-11-02 18:39:19 +00:00
).await
}