optimized initialization
This commit is contained in:
parent
da6ef34b0e
commit
b2eac5bfe0
@ -60,7 +60,7 @@ pub fn block(
|
||||
// validate and send batch
|
||||
let finalized_batch = batch.finalize();
|
||||
send_and_process(&finalized_batch)?;
|
||||
if fwlen < &mut ips_add.len() {
|
||||
if fwlen != &mut ips_add.len() {
|
||||
ret.push(format!("{length} ip in firewall", length = ips_add.len()));
|
||||
}
|
||||
*fwlen = ips_add.len();
|
||||
|
@ -89,7 +89,7 @@ async fn listenpubsub(ctx: &Arc<Mutex<Context>>, txpubsub: Sender<IpData>, socke
|
||||
Some(ss) => {
|
||||
let msg = ss.strip_prefix(prefix.as_str()).unwrap();
|
||||
let tosend: IpData = serde_json::from_str(msg).unwrap();
|
||||
if tosend.hostname != gethostname(true) {
|
||||
if tosend.hostname != gethostname(true) || tosend.mode == "zmq".to_string() {
|
||||
txpubsub.send(tosend).await.unwrap();
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user