From db6babfd7204aa2ea3283ee2977422d79df21cf7 Mon Sep 17 00:00:00 2001 From: jdwldnqi837 <47104234+jdwldnqi837@users.noreply.github.com> Date: Thu, 16 Jan 2020 23:37:24 +0800 Subject: [PATCH] Fix: Log update thread do not exit after call ownerAPI. (#284) --- libwallet/src/api_impl/owner_updater.rs | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/libwallet/src/api_impl/owner_updater.rs b/libwallet/src/api_impl/owner_updater.rs index 78f61c62..b49d790e 100644 --- a/libwallet/src/api_impl/owner_updater.rs +++ b/libwallet/src/api_impl/owner_updater.rs @@ -57,8 +57,8 @@ pub fn start_updater_log_thread( ) -> Result<(), Error> { let _ = thread::Builder::new() .name("wallet-updater-status".to_string()) - .spawn(move || loop { - while let Ok(m) = rx.try_recv() { + .spawn(move || { + while let Ok(m) = rx.recv() { // save to our message queue to be read by other consumers { let mut q = queue.lock(); @@ -79,7 +79,6 @@ pub fn start_updater_log_thread( StatusMessage::UpdateWarning(s) => warn!("{}", s), } } - thread::sleep(Duration::from_millis(500)); })?; Ok(())