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 {
122
122
sch .l .Debug ("Checking for @reboot task chains..." )
123
123
sch .retrieveChainsAndRun (ctx , true )
124
124
125
+ // Use ticker for strict intervals
126
+ ticker := time .NewTicker (refetchTimeout * time .Second )
127
+ defer ticker .Stop ()
125
128
for {
126
129
sch .l .Debug ("Checking for task chains..." )
127
130
go sch .retrieveChainsAndRun (ctx , false )
128
131
sch .l .Debug ("Checking for interval task chains..." )
129
132
go sch .retrieveIntervalChainsAndRun (ctx )
130
133
131
134
select {
132
- case <- time . After ( refetchTimeout * time . Second ) :
135
+ case <- ticker . C :
133
136
// pass
134
137
case <- ctx .Done ():
135
138
sch .status = ContextCancelledStatus
136
139
case <- sch .shutdown :
137
140
sch .status = ShutdownStatus
138
141
sch .terminateChains ()
139
142
}
140
-
141
143
if sch .status != RunningStatus {
142
144
return sch .status
143
145
}
You can’t perform that action at this time.
0 commit comments