Skip to content

Commit

Permalink
Run reflector in a goroutine
Browse files Browse the repository at this point in the history
  • Loading branch information
soltysh committed Nov 6, 2017
1 parent 21e04c5 commit 50e1bd3
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion pkg/apps/strategy/support/lifecycle.go
Original file line number Diff line number Diff line change
Expand Up @@ -467,7 +467,7 @@ func newPodWatch(client kcoreclient.PodInterface, namespace, name, resourceVersi
}

queue := cache.NewResyncableFIFO(cache.MetaNamespaceKeyFunc)
cache.NewReflector(podLW, &kapi.Pod{}, queue, 1*time.Minute).Run(stopChannel)
go cache.NewReflector(podLW, &kapi.Pod{}, queue, 1*time.Minute).Run(stopChannel)

return func() *kapi.Pod {
obj := cache.Pop(queue)
Expand Down
2 changes: 1 addition & 1 deletion pkg/network/common/common.go
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@ func newEventQueue(client kcache.Getter, resourceName ResourceName, expectedType
eventQueue := NewEventQueue(DeletionHandlingMetaNamespaceKeyFunc)
// Repopulate event queue every 30 mins
// Existing items in the event queue will have watch.Modified event type
kcache.NewReflector(lw, expectedType, eventQueue, 30*time.Minute).Run(wait.NeverStop)
go kcache.NewReflector(lw, expectedType, eventQueue, 30*time.Minute).Run(wait.NeverStop)
return eventQueue
}

Expand Down
2 changes: 1 addition & 1 deletion pkg/router/template/service_lookup.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ func NewListWatchServiceLookup(svcGetter kcoreclient.ServicesGetter, resync time
return svcGetter.Services(api.NamespaceAll).Watch(options)
},
}
cache.NewReflector(lw, &api.Service{}, svcStore, resync).Run(wait.NeverStop)
go cache.NewReflector(lw, &api.Service{}, svcStore, resync).Run(wait.NeverStop)

return &serviceLWLookup{
store: svcStore,
Expand Down

0 comments on commit 50e1bd3

Please sign in to comment.