1
0
mirror of https://github.com/rancher/steve.git synced 2025-04-28 03:10:32 +00:00

Make notifier optional

This commit is contained in:
Darren Shepherd 2020-07-14 13:28:21 -07:00
parent f4ef308923
commit 34e6de07fb

View File

@ -303,15 +303,17 @@ func (s *Store) listAndWatch(apiOp *types.APIRequest, k8sClient dynamic.Resource
watcher.Stop()
}()
eg.Go(func() error {
for rel := range s.notifier.OnInboundRelationshipChange(ctx, schema, apiOp.Namespace) {
obj, err := s.byID(apiOp, schema, rel.Name)
if err == nil {
result <- s.toAPIEvent(apiOp, schema, watch.Modified, obj)
if s.notifier != nil {
eg.Go(func() error {
for rel := range s.notifier.OnInboundRelationshipChange(ctx, schema, apiOp.Namespace) {
obj, err := s.byID(apiOp, schema, rel.Name)
if err == nil {
result <- s.toAPIEvent(apiOp, schema, watch.Modified, obj)
}
}
}
return fmt.Errorf("closed")
})
return fmt.Errorf("closed")
})
}
eg.Go(func() error {
for event := range watcher.ResultChan() {