Skip to content

Commit

Permalink
Pull creating telegram consumers out of main loop
Browse files Browse the repository at this point in the history
  • Loading branch information
mthmulders committed Dec 2, 2023
1 parent 9540eb7 commit 50f6765
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/scheduler.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@ pub fn main_loop(
read_interval: f64,
) {
let interval = time::Duration::from_millis((read_interval * 1_000.0).round() as u64);
let mut consumer = dsmr::sender::DelegatingConsumer::new(&api_settings.hosts);

loop {
{
let port = dsmr::reader::connect_to_meter(&serial_settings);
let mut consumer = dsmr::sender::DelegatingConsumer::new(&api_settings.hosts);

dsmr::reader::read_from_serial_port(port, &mut consumer);

Expand Down

0 comments on commit 50f6765

Please sign in to comment.