19 lines
483 B
Rust
19 lines
483 B
Rust
|
use crate::config::Context;
|
||
|
use crate::ip::{push_ip, IpData};
|
||
|
use crate::utils::sleep_s;
|
||
|
|
||
|
pub async fn send_to_ipbl_ws(ctx: &Context, ip: &mut IpData, ret: &mut Vec<String>) {
|
||
|
ret.push(format!("host: {hostname}", hostname = ctx.hostname));
|
||
|
loop {
|
||
|
match push_ip(&ctx, &ip, ret).await {
|
||
|
Ok(_) => {
|
||
|
break;
|
||
|
}
|
||
|
Err(err) => {
|
||
|
println!("{err}");
|
||
|
sleep_s(1);
|
||
|
}
|
||
|
};
|
||
|
}
|
||
|
}
|