ipblc/src/ws.rs
2023-01-08 21:16:20 +01:00

19 lines
489 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).await;
}
};
}
}