This commit is contained in:
parent
bb9404ec7c
commit
35ac52ed46
@ -156,15 +156,15 @@ impl Context {
|
|||||||
|
|
||||||
pub async fn get_blocklist_toblock(&mut self) -> Vec<IpData> {
|
pub async fn get_blocklist_toblock(&mut self) -> Vec<IpData> {
|
||||||
let mut res: Vec<IpData> = vec![];
|
let mut res: Vec<IpData> = vec![];
|
||||||
let now: DateTime<Local> = Local::now().trunc_subsecs(0);
|
//let now: DateTime<Local> = Local::now().trunc_subsecs(0);
|
||||||
for (_, block) in self.blocklist.iter_mut() {
|
for (_, block) in self.blocklist.iter_mut() {
|
||||||
match self.cfg.sets.get(&block.ipdata.src) {
|
match self.cfg.sets.get(&block.ipdata.src) {
|
||||||
Some(set) => {
|
Some(set) => {
|
||||||
if block.tryfail >= set.tryfail {
|
if block.tryfail >= set.tryfail {
|
||||||
res.push(block.ipdata.clone());
|
res.push(block.ipdata.clone());
|
||||||
if block.tryfail == set.tryfail {
|
/*if block.tryfail == set.tryfail {
|
||||||
block.starttime = DateTime::from(now);
|
block.starttime = DateTime::from(now);
|
||||||
}
|
}*/
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
None => {}
|
None => {}
|
||||||
|
@ -70,7 +70,7 @@ pub async fn run() {
|
|||||||
//let mut received_ip = ipdatarx.recv();
|
//let mut received_ip = ipdatarx.recv();
|
||||||
let ipdata_wait = ipeventrx.recv();
|
let ipdata_wait = ipeventrx.recv();
|
||||||
let apimsg_wait = apirx.recv();
|
let apimsg_wait = apirx.recv();
|
||||||
let force_wait = sleep_ms(500);
|
let force_wait = sleep_ms(200);
|
||||||
|
|
||||||
let ctxclone = Arc::clone(&ctxarc);
|
let ctxclone = Arc::clone(&ctxarc);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user