This commit is contained in:
parent
cdc3ac4064
commit
dc3405d07a
@ -73,6 +73,7 @@ impl Context {
|
||||
GIT_VERSION,
|
||||
gethostname(false)
|
||||
))
|
||||
.timeout(Duration::seconds(15).to_std().unwrap())
|
||||
.build()
|
||||
.unwrap(),
|
||||
sas: HashMap::new(),
|
||||
|
@ -5,8 +5,10 @@ use crate::utils::sleep_s;
|
||||
use reqwest::Client;
|
||||
use reqwest::Error as ReqError;
|
||||
|
||||
const MAX_FAILED_API_RATE: u64 = 10;
|
||||
|
||||
pub async fn send_to_ipbl_api(client: &Client, server: &str, ip: &IpEvent) {
|
||||
let mut i = 1;
|
||||
let mut i = 0;
|
||||
loop {
|
||||
match push_ip(&client, &server, &ip.ipdata).await {
|
||||
Ok(_) => {
|
||||
@ -15,7 +17,7 @@ pub async fn send_to_ipbl_api(client: &Client, server: &str, ip: &IpEvent) {
|
||||
Err(err) => {
|
||||
println!("{err}");
|
||||
sleep_s(1).await;
|
||||
if i == 10 {
|
||||
if i == MAX_FAILED_API_RATE {
|
||||
break;
|
||||
}
|
||||
i += 1;
|
||||
|
Loading…
Reference in New Issue
Block a user