write db on termination
This commit is contained in:
parent
73416c886f
commit
d5b8a4a858
13
src/main.rs
13
src/main.rs
|
@ -77,9 +77,10 @@ fn signal_termination() {
|
||||||
}
|
}
|
||||||
|
|
||||||
fn main() {
|
fn main() {
|
||||||
let parser = clap::App::new("udpt")
|
let parser = clap::App::new(env!("CARGO_PKG_NAME"))
|
||||||
.about("High performance, lightweight, udp based torrent tracker.")
|
.about(env!("CARGO_PKG_DESCRIPTION"))
|
||||||
.author("Naim A. <naim94a@gmail.com>")
|
.author(env!("CARGO_PKG_AUTHORS"))
|
||||||
|
.version(env!("CARGO_PKG_VERSION"))
|
||||||
.arg(
|
.arg(
|
||||||
clap::Arg::with_name("config")
|
clap::Arg::with_name("config")
|
||||||
.takes_value(true)
|
.takes_value(true)
|
||||||
|
@ -229,4 +230,10 @@ fn main() {
|
||||||
let _ = thread.join();
|
let _ = thread.join();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if let Some(db_path) = cfg.get_db_path() {
|
||||||
|
info!("running final cleanup & saving database...");
|
||||||
|
tracker.periodic_task(db_path.as_str());
|
||||||
|
}
|
||||||
|
info!("goodbye.");
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue