send a reply when thread is done exiting

fixed failing tests

fix tests

handle error instead of just unwrappng it

create a channel per thread and update tests with a call to rx.recv().unwrap()
This commit is contained in:
Abelardo E. Mendoza 2016-05-29 13:00:09 -06:00
parent e8e7c6545d
commit 88980dc7a5
6 changed files with 33 additions and 11 deletions

View file

@ -210,7 +210,7 @@ impl ResourceChannelManager {
CoreResourceMsg::Synchronize(sender) => {
let _ = sender.send(());
}
CoreResourceMsg::Exit => {
CoreResourceMsg::Exit(sender) => {
if let Some(ref config_dir) = opts::get().config_dir {
match self.resource_manager.auth_cache.read() {
Ok(auth_cache) => write_json_to_file(&*auth_cache, config_dir, "auth_cache.json"),
@ -225,6 +225,7 @@ impl ResourceChannelManager {
Err(_) => warn!("Error writing hsts list to disk"),
}
}
let _ = sender.send(());
break;
}