mirror of
https://github.com/kubernetes-sigs/external-dns.git
synced 2025-08-06 09:36:58 +02:00
parent
e664bde484
commit
daeda2ed53
@ -66,14 +66,15 @@ func (c *Controller) RunOnce() error {
|
||||
|
||||
// Run runs RunOnce in a loop with a delay until stopChan receives a value.
|
||||
func (c *Controller) Run(stopChan <-chan struct{}) {
|
||||
ticker := time.NewTicker(c.Interval)
|
||||
defer ticker.Stop()
|
||||
for {
|
||||
err := c.RunOnce()
|
||||
if err != nil {
|
||||
log.Error(err)
|
||||
}
|
||||
|
||||
select {
|
||||
case <-time.After(c.Interval):
|
||||
case <-ticker.C:
|
||||
case <-stopChan:
|
||||
log.Info("Terminating main controller loop")
|
||||
return
|
||||
|
Loading…
Reference in New Issue
Block a user