Skip to content

Commit 1c4d7a5

Browse files
committed
Fix timer of periodic sources
Signed-off-by: Didier Wenzek <[email protected]>
1 parent 031561e commit 1c4d7a5

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

crates/extensions/tedge_flows/src/runtime.rs

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -95,10 +95,18 @@ impl MessageProcessor {
9595
}
9696

9797
fn deadlines(&self) -> impl Iterator<Item = tokio::time::Instant> + '_ {
98-
self.flows
98+
let script_deadlines = self
99+
.flows
99100
.values()
100101
.flat_map(|flow| &flow.steps)
101-
.filter_map(|step| step.script.next_execution)
102+
.filter_map(|step| step.script.next_execution);
103+
104+
let source_deadlines = self
105+
.flows
106+
.values()
107+
.filter_map(|flow| flow.input.next_deadline());
108+
109+
script_deadlines.chain(source_deadlines)
102110
}
103111

104112
/// Get the next deadline for interval execution across all scripts

0 commit comments

Comments
 (0)