From f60ad0262022e73337309cd66ca0b3e52a909744 Mon Sep 17 00:00:00 2001 From: Raphael Date: Sun, 19 Apr 2026 18:47:57 +0200 Subject: [PATCH 1/2] fix: correct flow identification syntax --- adapter/cron/src/main.rs | 28 +++++++++++++++++++++++++--- 1 file changed, 25 insertions(+), 3 deletions(-) diff --git a/adapter/cron/src/main.rs b/adapter/cron/src/main.rs index 94f17a9..7b27a86 100644 --- a/adapter/cron/src/main.rs +++ b/adapter/cron/src/main.rs @@ -57,6 +57,7 @@ fn extract_flow_setting_field(flow: &ValidationFlow, name: &str) -> Option bool { + log::debug!("Trying to identify flow with flow id: {}", flow.flow_id); let Some(minute) = extract_flow_setting_field(flow, "cronMinute") else { return false; }; @@ -73,6 +74,16 @@ impl IdentifiableFlow for Time { return false; }; + log::debug!( + "flow with id: {} has the following cron configuration {} {} {} {} {}", + flow.flow_id, + minute, + hour, + dom, + month, + dow + ); + let expression = format!("* {} {} {} {} {}", minute, hour, dom, month, dow); let schedule = match Schedule::from_str(expression.as_str()) { Ok(s) => s, @@ -93,11 +104,22 @@ impl IdentifiableFlow for Time { } }; - self.now.year() == next.year() + let is_match = self.now.year() == next.year() && self.now.month() == next.month() && self.now.day() == next.day() && self.now.hour() == next.hour() - && self.now.minute() == next.minute() + && self.now.minute() == next.minute(); + + match is_match { + true => { + log::debug!("Flow with id: {} was a match", flow.flow_id); + is_match + } + false => { + log::debug!("Flow with id: {} was no match", flow.flow_id); + is_match + } + } } } @@ -111,7 +133,7 @@ impl Server for Cron { log::info!("Starting Cron adapter"); let expression = "0 * * * * *"; let schedule = Schedule::from_str(expression)?; - let pattern = "CRON.<"; + let pattern = "CRON.*"; loop { let now = Utc::now(); From c1090337484a4984b7bdfd68b54a469f2a169ab5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Raphael=20G=C3=B6tz?= <52959657+raphael-goetz@users.noreply.github.com> Date: Sun, 19 Apr 2026 18:53:36 +0200 Subject: [PATCH 2/2] Update adapter/cron/src/main.rs MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> Signed-off-by: Raphael Götz <52959657+raphael-goetz@users.noreply.github.com> --- adapter/cron/src/main.rs | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/adapter/cron/src/main.rs b/adapter/cron/src/main.rs index 7b27a86..644d6e8 100644 --- a/adapter/cron/src/main.rs +++ b/adapter/cron/src/main.rs @@ -110,16 +110,13 @@ impl IdentifiableFlow for Time { && self.now.hour() == next.hour() && self.now.minute() == next.minute(); - match is_match { - true => { - log::debug!("Flow with id: {} was a match", flow.flow_id); - is_match - } - false => { - log::debug!("Flow with id: {} was no match", flow.flow_id); - is_match - } + if is_match { + log::debug!("Flow with id: {} was a match", flow.flow_id); + } else { + log::debug!("Flow with id: {} was no match", flow.flow_id); } + + is_match } }