Skip to content

Commit 5e20571

Browse files
author
Ravi Sankar Penta
committed
Fix project sync interval in router
ResyncInterval is tunable param and it can go as low as 1 second.
1 parent 172349c commit 5e20571

File tree

1 file changed

+10
-5
lines changed

1 file changed

+10
-5
lines changed

pkg/router/controller/factory/factory.go

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -77,15 +77,20 @@ func (f *RouterControllerFactory) Create(plugin router.Plugin, watchNodes, enabl
7777
NamespaceRoutes: make(map[string]map[string]*routeapi.Route),
7878
NamespaceEndpoints: make(map[string]map[string]*kapi.Endpoints),
7979

80-
ProjectClient: f.ProjectClient,
81-
ProjectLabels: f.ProjectLabels,
82-
// Check projects a bit more often than we resync events, so that we aren't always waiting
83-
// the maximum interval for new items to come into the list
84-
ProjectSyncInterval: f.ResyncInterval - 10*time.Second,
80+
ProjectClient: f.ProjectClient,
81+
ProjectLabels: f.ProjectLabels,
8582
ProjectWaitInterval: 10 * time.Second,
8683
ProjectRetries: 5,
8784
}
8885

86+
// Check projects a bit more often than we resync events, so that we aren't always waiting
87+
// the maximum interval for new items to come into the list
88+
if f.ResyncInterval > 10*time.Second {
89+
rc.ProjectSyncInterval = f.ResyncInterval - 10*time.Second
90+
} else {
91+
rc.ProjectSyncInterval = f.ResyncInterval
92+
}
93+
8994
f.initInformers(rc)
9095
f.processExistingItems(rc)
9196
f.registerInformerEventHandlers(rc)

0 commit comments

Comments
 (0)