Add flag to allow custom ingress status update intervals (#5050)

This commit is contained in:
Manuel Alejandro de Brito Fontes 2020-02-10 16:52:50 -03:00 committed by GitHub
parent 5e54f66ab2
commit 2c5819e1b3
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 15 additions and 4 deletions

View file

@ -40,9 +40,9 @@ import (
"k8s.io/ingress-nginx/internal/task"
)
const (
updateInterval = 60 * time.Second
)
// UpdateInterval defines the time interval, in seconds, in
// which the status should check if an update is required.
var UpdateInterval = 60
// Syncer ...
type Syncer interface {
@ -98,7 +98,7 @@ func (s statusSync) Run(stopCh chan struct{}) {
// when this instance is the leader we need to enqueue
// an item to trigger the update of the Ingress status.
wait.PollUntil(updateInterval, func() (bool, error) {
wait.PollUntil(time.Duration(UpdateInterval)*time.Second, func() (bool, error) {
s.syncQueue.EnqueueTask(task.GetDummyObject("sync status"))
return false, nil
}, stopCh)