Skip to content

Commit

Permalink
Mix random data every hour
Browse files Browse the repository at this point in the history
  • Loading branch information
nledford committed Jun 17, 2024
1 parent 70b1c14 commit 2e58ce0
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/cli/run.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ use tokio::time::sleep;
use crate::profiles::profile::Profile;
use crate::profiles::ProfileAction;
use crate::state::AppState;
use crate::utils;

#[derive(Args, Debug, PartialEq)]
pub struct RunCmds {
Expand All @@ -37,10 +38,15 @@ pub async fn execute_run_cmd(cmd: RunCmds, app_state: &AppState) -> Result<()> {
if cmd.run_loop {
loop {
sleep(Duration::from_secs(1)).await;
let now = Local::now();

if Local::now().second() == 0 {
if now.second() == 0 {
perform_refresh(app_state, cmd.run_loop, true).await?;
}

if now.minute() == 0 && now.second() == 0 {
utils::mix_random_data().await?;
}
}
}

Expand Down

0 comments on commit 2e58ce0

Please sign in to comment.