Removed +10 Days Counter
This commit is contained in:
@@ -15,7 +15,7 @@ use std::{
|
|||||||
fs::{self, File},
|
fs::{self, File},
|
||||||
io::Read,
|
io::Read,
|
||||||
path::PathBuf,
|
path::PathBuf,
|
||||||
str::FromStr,
|
str::FromStr, sync::mpsc::{Sender, Receiver, channel},
|
||||||
};
|
};
|
||||||
|
|
||||||
#[derive(Debug, Deserialize, Serialize)]
|
#[derive(Debug, Deserialize, Serialize)]
|
||||||
@@ -96,7 +96,9 @@ pub fn pull_policy_exec_histories(
|
|||||||
let client = build_client(py, &py_self);
|
let client = build_client(py, &py_self);
|
||||||
let api: Py<PyAny> = py_self;
|
let api: Py<PyAny> = py_self;
|
||||||
let cutoff = Local::now().naive_local() - Duration::days(days);
|
let cutoff = Local::now().naive_local() - Duration::days(days);
|
||||||
|
let (tx, rx):(Sender<Group>, Receiver<Group>) = channel();
|
||||||
loop {
|
loop {
|
||||||
|
let thread_tx = tx.clone();
|
||||||
let execution_histories = history_logging(
|
let execution_histories = history_logging(
|
||||||
py,
|
py,
|
||||||
&api,
|
&api,
|
||||||
@@ -178,7 +180,7 @@ pub fn pull_policy_exec_histories(
|
|||||||
{
|
{
|
||||||
let date_diff = Local::now().naive_local().date() - last_date;
|
let date_diff = Local::now().naive_local().date() - last_date;
|
||||||
let percentage_diff =
|
let percentage_diff =
|
||||||
((days + 10) - date_diff.num_days()) as f64 / (days + 10) as f64 * 100.0;
|
(days - date_diff.num_days()) as f64 / days as f64 * 100.0;
|
||||||
progress_bar.set_position(percentage_diff.round() as u64);
|
progress_bar.set_position(percentage_diff.round() as u64);
|
||||||
progress_bar.set_message("Total Percent Complete");
|
progress_bar.set_message("Total Percent Complete");
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user