Skip to content

Commit

Permalink
Superfluous 'config: BrokerConfig' parameter removed from broker_loop
Browse files Browse the repository at this point in the history
  • Loading branch information
Fanda Vacek committed Dec 31, 2023
1 parent 8f1d48f commit 5ad4957
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/bin/shvbroker/broker.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ use shv::rpcframe::RpcFrame;
use shv::rpcmessage::{CliId, RpcError, RpcErrorCode};
use shv::shvnode::{find_longest_prefix, process_local_dir_ls, RequestCommand, ShvNode, SIG_CHNG};
use shv::util::sha1_hash;
use crate::config::{AccessControl, BrokerConfig, Password};
use crate::config::{AccessControl, Password};
use crate::{node, Receiver, Sender};
use crate::node::BrokerCommand;

Expand Down Expand Up @@ -296,7 +296,7 @@ impl Broker {
}
}
}
pub(crate) async fn broker_loop(events: Receiver<ClientEvent>, _config: BrokerConfig, access: AccessControl) {
pub(crate) async fn broker_loop(events: Receiver<ClientEvent>, access: AccessControl) {

let mut broker = Broker::new(access);

Expand Down
3 changes: 2 additions & 1 deletion src/bin/shvbroker/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -91,12 +91,13 @@ async fn accept_loop(config: BrokerConfig, access: AccessControl) -> Result<()>
if let Some(address) = config.listen.tcp.clone() {
let (broker_sender, broker_receiver) = channel::unbounded();
let parent_broker_peer_config = config.parent_broker.clone();
let broker_task = task::spawn(broker::broker_loop(broker_receiver, config, access));
let broker_task = task::spawn(broker::broker_loop(broker_receiver, access));
if parent_broker_peer_config.enabled {
spawn_and_log_error(peer::parent_broker_peer_loop(1, parent_broker_peer_config, broker_sender.clone()));
}
info!("Listening on TCP: {}", address);
let listener = TcpListener::bind(address).await?;
info!("bind OK");
let mut client_id = 2; // parent broker has client_id == 1
let mut incoming = listener.incoming();
while let Some(stream) = incoming.next().await {
Expand Down
1 change: 1 addition & 0 deletions tests/common/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ impl KillProcessGuard {

pub fn is_running(&mut self) -> bool {
let status = self.child.try_wait().unwrap();
//println!("shvbroker is_running status: {:?}", status);
status.is_none()
}
}
Expand Down

0 comments on commit 5ad4957

Please sign in to comment.