renamed some variables
Some checks reported errors
continuous-integration/drone/push Build was killed
Some checks reported errors
continuous-integration/drone/push Build was killed
This commit is contained in:
parent
69d6074881
commit
65a93505b0
@ -60,22 +60,22 @@ pub async fn process(ctx: &Arc<Mutex<Context>>) {
|
|||||||
let begin: DateTime<Local> = Local::now().trunc_subsecs(0);
|
let begin: DateTime<Local> = Local::now().trunc_subsecs(0);
|
||||||
|
|
||||||
// wait for logs parse and zmq channel receive
|
// wait for logs parse and zmq channel receive
|
||||||
let mut recvip = ipdatarx.recv().await.unwrap();
|
let mut received_ip = ipdatarx.recv().await.unwrap();
|
||||||
|
|
||||||
// lock the context mutex
|
// lock the context mutex
|
||||||
let ctxarc = Arc::clone(&ctx);
|
let ctxarc = Arc::clone(&ctx);
|
||||||
let mut ctx = ctxarc.lock().await;
|
let mut ctx = ctxarc.lock().await;
|
||||||
|
|
||||||
if recvip.ip == "".to_string() && recvip.mode == "init".to_string() {
|
if received_ip.ip == "".to_string() && received_ip.mode == "init".to_string() {
|
||||||
for sndip in &mut ctx.get_blocklist_toblock().await {
|
for ip_to_send in &mut ctx.get_blocklist_toblock().await {
|
||||||
sndip.mode = "init".to_string();
|
ip_to_send.mode = "init".to_string();
|
||||||
send_to_ipbl_zmq(&reqsocket, sndip).await;
|
send_to_ipbl_zmq(&reqsocket, ip_to_send).await;
|
||||||
}
|
}
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
// refresh context blocklist
|
// refresh context blocklist
|
||||||
let filtered_ip = ctx.update_blocklist(&mut recvip).await;
|
let filtered_ip = ctx.update_blocklist(&mut received_ip).await;
|
||||||
ctx.gc_blocklist().await;
|
ctx.gc_blocklist().await;
|
||||||
|
|
||||||
// send ip list to ws and zmq sockets
|
// send ip list to ws and zmq sockets
|
||||||
|
Loading…
Reference in New Issue
Block a user