drop debug
parent
b57618889e
commit
89185f5016
|
|
@ -169,6 +169,15 @@ version = "0.8.7"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "773648b94d0e5d620f64f280777445740e61fe701025087ec8b57f45c791888b"
|
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]]
|
[[package]]
|
||||||
name = "equivalent"
|
name = "equivalent"
|
||||||
version = "1.0.2"
|
version = "1.0.2"
|
||||||
|
|
@ -357,6 +366,7 @@ version = "0.1.0"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"chrono",
|
"chrono",
|
||||||
"clap",
|
"clap",
|
||||||
|
"cron-parser",
|
||||||
"gethostname",
|
"gethostname",
|
||||||
"json-patch",
|
"json-patch",
|
||||||
"jsonptr",
|
"jsonptr",
|
||||||
|
|
|
||||||
|
|
@ -6,6 +6,7 @@ edition = "2024"
|
||||||
[dependencies]
|
[dependencies]
|
||||||
chrono = "0.4.42"
|
chrono = "0.4.42"
|
||||||
clap = { version = "4.5.51", features = ["derive"] }
|
clap = { version = "4.5.51", features = ["derive"] }
|
||||||
|
cron-parser = "0.11.0"
|
||||||
gethostname = "1.1.0"
|
gethostname = "1.1.0"
|
||||||
json-patch = "4.1.0"
|
json-patch = "4.1.0"
|
||||||
jsonptr = "0.7.1"
|
jsonptr = "0.7.1"
|
||||||
|
|
|
||||||
|
|
@ -528,16 +528,13 @@ impl Task {
|
||||||
schedule += "T00";
|
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}$")
|
if regex::Regex::new(r"[0-9]{4}-[0-9]{2}-[0-9]{2}T[0-9]{2}$")
|
||||||
.unwrap()
|
.unwrap()
|
||||||
.is_match(&schedule)
|
.is_match(&schedule)
|
||||||
{
|
{
|
||||||
eprintln!("1 PARSING DATE HOUR {} like %Y-%m-%dT%H", &schedule);
|
|
||||||
let date = schedule.clone() + ":00:00";
|
let date = schedule.clone() + ":00:00";
|
||||||
match chrono::NaiveDateTime::parse_from_str(&date, "%Y-%m-%dT%H:%M:%S") {
|
match chrono::NaiveDateTime::parse_from_str(&date, "%Y-%m-%dT%H:%M:%S") {
|
||||||
Ok(datehour) => {
|
Ok(datehour) => {
|
||||||
eprintln!("2 PARSING DATE HOUR {}", &schedule);
|
|
||||||
let seconds = datehour.format("%s").to_string();
|
let seconds = datehour.format("%s").to_string();
|
||||||
match seconds.parse::<u64>() {
|
match seconds.parse::<u64>() {
|
||||||
Ok(n) => return Some(n),
|
Ok(n) => return Some(n),
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue