Nareshkumar Rao 7 months ago
parent
commit
de6b9cf153
  1. 18
      src/control/data_logging.rs

18
src/control/data_logging.rs

@ -42,16 +42,16 @@ impl DataRecords {
}
pub async fn data_logging_loop(program_state: ProgramStateShared) {
let DataLoggingSettings {
enabled,
frequency_mins,
} = lock_state(&program_state)
.map(|state| state.config.data_logging_settings.clone())
.unwrap_or(DataLoggingSettings {
enabled: true,
frequency_mins: 60,
});
loop {
let DataLoggingSettings {
enabled,
frequency_mins,
} = lock_state(&program_state)
.map(|state| state.config.data_logging_settings.clone())
.unwrap_or(DataLoggingSettings {
enabled: true,
frequency_mins: 60,
});
if enabled {
let _ = DataRecords::push(program_state.clone());
}

Loading…
Cancel
Save