Add flag to allow custom ingress status update intervals (#5050)
This commit is contained in:
parent
5e54f66ab2
commit
2c5819e1b3
3 changed files with 15 additions and 4 deletions
|
|
@ -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)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue