File tree Expand file tree Collapse file tree 1 file changed +3
-5
lines changed
Expand file tree Collapse file tree 1 file changed +3
-5
lines changed Original file line number Diff line number Diff line change @@ -10,7 +10,7 @@ use kube::{
1010use log:: { error, info} ;
1111
1212use std:: time:: Duration as StdDuration ;
13- use tokio:: time:: interval ;
13+ use tokio:: time:: sleep ;
1414
1515use 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
You can’t perform that action at this time.
0 commit comments