1
1
Fork 0
mirror of https://github.com/DNSCrypt/encrypted-dns-server.git synced 2024-05-08 07:16:04 +02:00

Try to daemonize after tokio's runtime has been built

This commit is contained in:
Frank Denis 2021-09-15 21:57:00 +02:00
parent 630bcb67b2
commit 7cf89393c2

View File

@ -550,13 +550,15 @@ fn main() -> Result<(), Error> {
std::process::exit(1);
})
.unwrap();
privdrop(&config)?;
let mut runtime_builder = tokio::runtime::Builder::new_multi_thread();
runtime_builder.enable_all();
runtime_builder.thread_name("encrypted-dns-");
let runtime = runtime_builder.build()?;
privdrop(&config)?;
let key_cache_capacity = config.dnscrypt.key_cache_capacity;
let cache_capacity = config.cache_capacity;
let state_file = &config.state_file;