ipblc/src/ws.rs

19 lines
489 B
Rust
Raw Normal View History

2023-01-08 14:09:13 +01:00
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}");
2023-01-08 21:16:06 +01:00
sleep_s(1).await;
2023-01-08 14:09:13 +01:00
}
};
}
}