Compare commits

..

No commits in common. "b1196d51774e050e9d60dca6ea8ec24b93cb26fe" and "fd813b04b6564885385a990ea9998955db5888b7" have entirely different histories.

3 changed files with 3 additions and 12 deletions

View File

@ -31,6 +31,3 @@ IM_LOG_INFO = "INFO"
# IM configuration for setting up API connetion # IM configuration for setting up API connetion
# timeout (in secs). Default value - 10 # timeout (in secs). Default value - 10
IM_CONNECTION_TIMEOUT = "10" IM_CONNECTION_TIMEOUT = "10"
# IM configuration for delay of requests
# delay (in secs). Default value - 5
IM_REQUEST_DELAY = "20"

View File

@ -1,6 +1,6 @@
[package] [package]
name = "api-grub" name = "api-grub"
version = "1.0.15" version = "1.0.11"
edition = "2021" edition = "2021"
authors = ["Vladislav Drozdov <maseeeeeeeed@gmail.com>"] authors = ["Vladislav Drozdov <maseeeeeeeed@gmail.com>"]
description = "API poller for ZVKS project" description = "API poller for ZVKS project"

View File

@ -36,16 +36,10 @@ async fn main() -> Result<()>{
}, },
} }
}); });
let request_delay = std::env::var("IM_REQUEST_DELAY")
.unwrap_or_else(|_| String::from("5"))
.parse::<u32>()
.unwrap_or_else(|_| {
warn!("No delay was set, setting up as 5 secs ..."); 5
});
let event_grub = tokio::spawn(async move { let event_grub = tokio::spawn(async move {
// GRAB USING eNODE.MONITORING API GATEWAY // GRAB USING eNODE.MONITORING API GATEWAY
if std::env::var("ENODE_MONITORING_IP").is_ok() { if std::env::var("ENODE_MONITORING_IP").is_ok() {
match get_metrics_from_monitoring(0, request_delay as usize).await { match get_metrics_from_monitoring(0, 5).await {
Ok(_) => info!("Grabing (eNODE.Monitoring) task de-initialized"), Ok(_) => info!("Grabing (eNODE.Monitoring) task de-initialized"),
Err(er) => error!("Grabing task returned an error : {}", er), Err(er) => error!("Grabing task returned an error : {}", er),
} }