fix bug in bootstrap
Some checks reported errors
continuous-integration/drone/push Build encountered an error

This commit is contained in:
Paul 2023-01-15 16:53:58 +01:00
parent df2668cdc1
commit 72d377f53f

View File

@ -79,12 +79,13 @@ pub async fn run() {
if received_ip.msgtype == "bootstrap".to_string() { if received_ip.msgtype == "bootstrap".to_string() {
for ip_to_send in ctx.get_blocklist_toblock().await { for ip_to_send in ctx.get_blocklist_toblock().await {
let event = IpEvent{ let ipe = IpEvent{
msgtype: String::from("init"), msgtype: String::from("init"),
ipdata: ip_to_send, ipdata: ip_to_send,
}; };
send_to_ipbl_zmq(&zmqreqsocket, &event).await; send_to_ipbl_zmq(&zmqreqsocket, &ipe).await;
} }
continue
} }
// refresh context blocklist // refresh context blocklist
@ -92,13 +93,15 @@ pub async fn run() {
// send ip list to ws and zmq sockets // send ip list to ws and zmq sockets
if let Some(ip) = filtered_ip { if let Some(ip) = filtered_ip {
println!("sending {} to ws and zmq", ip.ip); if received_ip.msgtype != "init" {
send_to_ipbl_ws(&ctx, &ip, &mut ret).await; println!("sending {} to ws and zmq", ip.ip);
let event = IpEvent{ send_to_ipbl_ws(&ctx, &ip, &mut ret).await;
msgtype: String::from("add"), let event = IpEvent{
ipdata: ip, msgtype: String::from("add"),
}; ipdata: ip,
send_to_ipbl_zmq(&zmqreqsocket, &event).await; };
send_to_ipbl_zmq(&zmqreqsocket, &event).await;
}
} }
} }
_val = apimsg_wait => { _val = apimsg_wait => {