Skip to content

Commit

Permalink
Fix project sync interval in router
Browse files Browse the repository at this point in the history
ResyncInterval is tunable param and it can go as low as 1 second.
  • Loading branch information
Ravi Sankar Penta committed Oct 23, 2017
1 parent 172349c commit 5e20571
Showing 1 changed file with 10 additions and 5 deletions.
15 changes: 10 additions & 5 deletions pkg/router/controller/factory/factory.go
Original file line number Diff line number Diff line change
Expand Up @@ -77,15 +77,20 @@ func (f *RouterControllerFactory) Create(plugin router.Plugin, watchNodes, enabl
NamespaceRoutes: make(map[string]map[string]*routeapi.Route),
NamespaceEndpoints: make(map[string]map[string]*kapi.Endpoints),

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

// Check projects a bit more often than we resync events, so that we aren't always waiting
// the maximum interval for new items to come into the list
if f.ResyncInterval > 10*time.Second {
rc.ProjectSyncInterval = f.ResyncInterval - 10*time.Second
} else {
rc.ProjectSyncInterval = f.ResyncInterval
}

f.initInformers(rc)
f.processExistingItems(rc)
f.registerInformerEventHandlers(rc)
Expand Down

0 comments on commit 5e20571

Please sign in to comment.