drop debug

master
Bel LaPointe 2025-11-12 14:00:08 -07:00
parent b57618889e
commit 89185f5016
3 changed files with 11 additions and 3 deletions

10
pttodoest/Cargo.lock generated
View File

@ -169,6 +169,15 @@ version = "0.8.7"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "773648b94d0e5d620f64f280777445740e61fe701025087ec8b57f45c791888b"
[[package]]
name = "cron-parser"
version = "0.11.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "702858ce99daf23d8822fb22ec363b641b4bdcd9704182211fc113b01870f6de"
dependencies = [
"chrono",
]
[[package]]
name = "equivalent"
version = "1.0.2"
@ -357,6 +366,7 @@ version = "0.1.0"
dependencies = [
"chrono",
"clap",
"cron-parser",
"gethostname",
"json-patch",
"jsonptr",

View File

@ -6,6 +6,7 @@ edition = "2024"
[dependencies]
chrono = "0.4.42"
clap = { version = "4.5.51", features = ["derive"] }
cron-parser = "0.11.0"
gethostname = "1.1.0"
json-patch = "4.1.0"
jsonptr = "0.7.1"

View File

@ -528,16 +528,13 @@ impl Task {
schedule += "T00";
}
eprintln!("0 PARSING DATE HOUR {}", &schedule);
if regex::Regex::new(r"[0-9]{4}-[0-9]{2}-[0-9]{2}T[0-9]{2}$")
.unwrap()
.is_match(&schedule)
{
eprintln!("1 PARSING DATE HOUR {} like %Y-%m-%dT%H", &schedule);
let date = schedule.clone() + ":00:00";
match chrono::NaiveDateTime::parse_from_str(&date, "%Y-%m-%dT%H:%M:%S") {
Ok(datehour) => {
eprintln!("2 PARSING DATE HOUR {}", &schedule);
let seconds = datehour.format("%s").to_string();
match seconds.parse::<u64>() {
Ok(n) => return Some(n),