net: shutdown async runtime on exit

This commit is contained in:
Gregory Terzian 2020-05-27 17:10:54 +08:00
parent 34a41f57c6
commit fa765168b9
2 changed files with 11 additions and 5 deletions

View file

@ -152,7 +152,7 @@ fn create_http_states(
http_cache_state: Mutex::new(HashMap::new()),
client: create_http_client(
create_tls_config(&certs, ALPN_H2_H1),
HANDLE.lock().unwrap().executor(),
HANDLE.lock().unwrap().as_ref().unwrap().executor(),
),
};
@ -165,7 +165,7 @@ fn create_http_states(
http_cache_state: Mutex::new(HashMap::new()),
client: create_http_client(
create_tls_config(&certs, ALPN_H2_H1),
HANDLE.lock().unwrap().executor(),
HANDLE.lock().unwrap().as_ref().unwrap().executor(),
),
};
@ -591,6 +591,9 @@ impl CoreResourceManager {
// or a short timeout has been reached.
self.thread_pool.exit();
// Shut-down the async runtime used by fetch workers.
drop(HANDLE.lock().unwrap().take());
debug!("Exited CoreResourceManager");
}