Skip to content
Snippets Groups Projects
Commit 2f12f18c authored by Éloïs's avatar Éloïs
Browse files

[fix] core: 3rd module never launched

parent a68036fd
No related branches found
No related tags found
No related merge requests found
......@@ -56,7 +56,7 @@ use structopt::StructOpt;
use threadpool::ThreadPool;
/// Number of thread in plugins ThreadPool
pub static THREAD_POOL_SIZE: &'static usize = &2;
pub static THREAD_POOL_SIZE: &'static usize = &4;
#[macro_export]
macro_rules! durs_core_server {
......
......@@ -231,6 +231,7 @@ fn send_msg_to_several_receivers(
receivers: &[ModuleStaticName],
modules_senders: &HashMap<ModuleStaticName, mpsc::Sender<DursMsg>>,
) {
if !receivers.is_empty() {
// Send message by copy To all modules that subscribed to this event
for module_static_name in &receivers[1..] {
if let Some(module_sender) = modules_senders.get(module_static_name) {
......@@ -243,7 +244,6 @@ fn send_msg_to_several_receivers(
}
}
// Send message by move to the last module to be receive
if !receivers.is_empty() {
if let Some(module_sender) = modules_senders.get(&receivers[0]) {
module_sender.send(msg).unwrap_or_else(|_| {
panic!("Fatal error: fail to relay DursMsg to {:?} !", receivers[0])
......@@ -379,7 +379,8 @@ pub fn start_router(
);
// Log the number of modules_senders received
info!(
"Router thread receive {} module senders",
"Router thread receive '{}' module registration ({} modules registered).",
module_static_name.0,
modules_senders.len()
);
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment