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:
parent
f4ef308923
commit
34e6de07fb
@ -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() {
|
||||
|
Loading…
Reference in New Issue
Block a user