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