File tree Expand file tree Collapse file tree 1 file changed +3
-2
lines changed
pkg/controller/distributedrediscluster Expand file tree Collapse file tree 1 file changed +3
-2
lines changed Original file line number Diff line number Diff line change @@ -142,15 +142,16 @@ type IWaitHandle interface {
142142// we get a result from handler.Handler() or the timeout expires
143143func waiting (handler IWaitHandle , reqLogger logr.Logger ) error {
144144 timeout := time .After (handler .Timeout ())
145- tick := time .Tick (handler .Tick ())
145+ tick := time .NewTicker (time .Second )
146+ defer tick .Stop ()
146147 // Keep trying until we're timed out or got a result or got an error
147148 for {
148149 select {
149150 // Got a timeout! fail with a timeout error
150151 case <- timeout :
151152 return fmt .Errorf ("%s timed out" , handler .Name ())
152153 // Got a tick, we should check on Handler()
153- case <- tick :
154+ case <- tick . C :
154155 err := handler .Handler ()
155156 if err == nil {
156157 return nil
You can’t perform that action at this time.
0 commit comments