local repo reload

needed local repo reload because someone broke down everything
pull/9/head
prplV 2024-07-24 17:05:45 +03:00
parent b6810a8c52
commit f4c24c3993
1 changed files with 13 additions and 12 deletions

View File

@ -138,17 +138,17 @@ async fn main() {
if conf.is_ok() {
// guarranted safe unwrapping
config = conf.unwrap()[0].clone();
let idx = config[0].0.find('-').unwrap();
let true_milis: i64 = config[0].0
.chars()
.enumerate()
.filter(|(id, _)| *id < idx)
.map(|(_, chr)| chr)
.collect::<String>()
.parse()
.unwrap();
let date = chrono::DateTime::from_timestamp_millis(true_milis).unwrap();
log::info!("Log from {} was given", date);
// let idx = config[0].0.find('-').unwrap();
// let true_milis: i64 = config[0].0
// .chars()
// .enumerate()
// .filter(|(id, _)| *id < idx)
// .map(|(_, chr)| chr)
// .collect::<String>()
// .parse()
// .unwrap();
// let date = chrono::DateTime::from_timestamp_millis(true_milis).unwrap();
// log::info!("Log from {} was given", date);
} else {
// rewrite error handler
println!("error: {}", conf.unwrap_err());
@ -187,10 +187,11 @@ async fn main() {
std::cmp::Ordering::Equal => {
// server has sent equal version
processes = prcs;
log::info!("Local version is actual");
},
std::cmp::Ordering::Greater => {
// server has sent an elder version
log::info!("Local config version is more actual");
log::warn!("Local config version is more actual");
processes = local;
},
}