Browse Source

Correct RPC shutdown logging

refactor-mempool
Roman Zeyde 7 years ago
parent
commit
b8e07f153a
No known key found for this signature in database GPG Key ID: 87CAE5FA46917CBB
  1. 5
      src/rpc.rs

5
src/rpc.rs

@ -485,13 +485,14 @@ impl RPC {
info!("[{}] disconnected peer", addr); info!("[{}] disconnected peer", addr);
})); }));
} }
info!("stopping RPC server"); trace!("closing RPC connections");
for sender in senders.lock().unwrap().iter() { for sender in senders.lock().unwrap().iter() {
let _ = sender.send(Message::Done); let _ = sender.send(Message::Done);
} }
for child in children { for child in children {
let _ = child.join(); let _ = child.join();
} }
trace!("RPC connections are closed");
})), })),
}; };
handle handle
@ -504,7 +505,9 @@ impl RPC {
impl Drop for RPC { impl Drop for RPC {
fn drop(&mut self) { fn drop(&mut self) {
trace!("stop accepting new RPCs");
self.notification.send(Notification::Exit).unwrap(); self.notification.send(Notification::Exit).unwrap();
self.server.take().map(|t| t.join().unwrap()); self.server.take().map(|t| t.join().unwrap());
trace!("RPC server is stopped");
} }
} }

Loading…
Cancel
Save