mirror of
https://github.com/niusmallnan/steve.git
synced 2025-06-22 04:37:07 +00:00
Merge pull request #41 from jakefhyde/fix-relationship-closed-channel
This commit is contained in:
commit
283b01b970
@ -80,6 +80,7 @@ func (s *SummaryCache) OnInboundRelationshipChange(ctx context.Context, schema *
|
|||||||
s.cbs[id] = cb
|
s.cbs[id] = cb
|
||||||
|
|
||||||
go func() {
|
go func() {
|
||||||
|
defer close(ret)
|
||||||
for rel := range cb {
|
for rel := range cb {
|
||||||
if rel.Kind == kind &&
|
if rel.Kind == kind &&
|
||||||
rel.APIVersion == apiVersion &&
|
rel.APIVersion == apiVersion &&
|
||||||
@ -94,7 +95,6 @@ func (s *SummaryCache) OnInboundRelationshipChange(ctx context.Context, schema *
|
|||||||
s.Lock()
|
s.Lock()
|
||||||
defer s.Unlock()
|
defer s.Unlock()
|
||||||
close(cb)
|
close(cb)
|
||||||
defer close(ret)
|
|
||||||
delete(s.cbs, id)
|
delete(s.cbs, id)
|
||||||
}()
|
}()
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user