Skip to content

Commit 00b248d

Browse files
committed
Replace scheduler interval with sleep
1 parent 32efe07 commit 00b248d

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

src/scheduler.rs

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ use kube::{
1010
use log::{error, info};
1111

1212
use std::time::Duration as StdDuration;
13-
use tokio::time::interval;
13+
use tokio::time::sleep;
1414

1515
use std::{
1616
collections::HashMap,
@@ -398,8 +398,6 @@ impl Scheduler {
398398
}
399399

400400
async fn scheduler_loop(&mut self) -> Result<()> {
401-
let mut scheduler_interval = interval(StdDuration::from_secs(60));
402-
403401
loop {
404402
// Collect channels that should run jobs
405403
let (jobs_active_or_imminent, channels_to_run) = {
@@ -481,8 +479,8 @@ impl Scheduler {
481479
self.run_job_for_channel(&channel_name).await?;
482480
}
483481

484-
// Wait for the next tick (1 minute interval)
485-
scheduler_interval.tick().await;
482+
// Wait for 1 minute before next iteration
483+
sleep(StdDuration::from_secs(60)).await;
486484
}
487485
}
488486

0 commit comments

Comments
 (0)