File tree Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Original file line number Diff line number Diff line change @@ -122,22 +122,24 @@ func (sch *Scheduler) Run(ctx context.Context) RunStatus {
122122 sch .l .Debug ("Checking for @reboot task chains..." )
123123 sch .retrieveChainsAndRun (ctx , true )
124124
125+ // Use ticker for strict intervals
126+ ticker := time .NewTicker (refetchTimeout * time .Second )
127+ defer ticker .Stop ()
125128 for {
126129 sch .l .Debug ("Checking for task chains..." )
127130 go sch .retrieveChainsAndRun (ctx , false )
128131 sch .l .Debug ("Checking for interval task chains..." )
129132 go sch .retrieveIntervalChainsAndRun (ctx )
130133
131134 select {
132- case <- time . After ( refetchTimeout * time . Second ) :
135+ case <- ticker . C :
133136 // pass
134137 case <- ctx .Done ():
135138 sch .status = ContextCancelledStatus
136139 case <- sch .shutdown :
137140 sch .status = ShutdownStatus
138141 sch .terminateChains ()
139142 }
140-
141143 if sch .status != RunningStatus {
142144 return sch .status
143145 }
You can’t perform that action at this time.
0 commit comments