2023-11-27 14:09:14 +00:00
|
|
|
use std::time::Duration;
|
2023-11-29 13:27:46 +00:00
|
|
|
|
|
|
|
use chrono::Local;
|
2023-11-27 14:09:14 +00:00
|
|
|
use tokio::time;
|
2023-11-30 01:40:28 +00:00
|
|
|
use tokio::time::Instant;
|
2023-11-25 23:54:03 +00:00
|
|
|
|
2023-11-29 13:27:46 +00:00
|
|
|
use crate::settings::Settings;
|
|
|
|
|
2023-11-25 23:54:03 +00:00
|
|
|
#[allow(unused_variables)]
|
|
|
|
pub async fn run_relay_loop(settings: Settings) {
|
2023-11-27 14:09:14 +00:00
|
|
|
let default_duration = Duration::from_millis(1000);
|
|
|
|
loop {
|
2023-11-30 01:40:28 +00:00
|
|
|
let next_timestamp = Instant::now() + default_duration;
|
|
|
|
time::sleep_until(next_timestamp).await;
|
|
|
|
log::debug!("Relay loop: {}", Local::now().naive_local().time())
|
2023-11-27 14:09:14 +00:00
|
|
|
}
|
2023-11-27 11:49:40 +00:00
|
|
|
}
|