From a0fa2532e408281f60587c72a2fd21799b237e9d Mon Sep 17 00:00:00 2001 From: Shamir Khodzha Date: Thu, 4 Jun 2020 20:37:18 +0300 Subject: [PATCH] named notifications loop thread --- src/app/mod.rs | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/src/app/mod.rs b/src/app/mod.rs index 0f28999d..b7820259 100644 --- a/src/app/mod.rs +++ b/src/app/mod.rs @@ -55,13 +55,16 @@ pub(crate) async fn run(db: &ConnectionPool, authz_cache: Option) -> // Event loop for incoming messages of MQTT Agent let (mq_tx, mut mq_rx) = futures_channel::mpsc::unbounded::(); - thread::spawn(move || { - for message in rx { - if let Err(_) = mq_tx.unbounded_send(message) { - error!("Error sending message to the internal channel"); + thread::Builder::new() + .name("conference-notifications-loop".to_owned()) + .spawn(move || { + for message in rx { + if let Err(_) = mq_tx.unbounded_send(message) { + error!("Error sending message to the internal channel"); + } } - } - }); + }) + .expect("Failed to start conference notifications loop"); // Authz let authz = svc_authz::ClientMap::new(&config.id, authz_cache, config.authz.clone())