Skip to content

Commit

Permalink
Merge pull request #370 from rmweir/proxy-store-context
Browse files Browse the repository at this point in the history
Change context in realWatch
  • Loading branch information
ibuildthecloud committed Jun 9, 2020
2 parents f53cae1 + b2f581c commit 00d3503
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions store/proxy/proxy_store.go
Original file line number Diff line number Diff line change
Expand Up @@ -296,7 +296,7 @@ func (s *Store) realWatch(apiContext *types.APIContext, schema *types.Schema, op
ResourceVersion: "0",
}, metav1.ParameterCodec)

body, err := req.Stream(apiContext.Request.Context())
body, err := req.Stream(s.close)
if err != nil {
return nil, err
}
Expand All @@ -305,7 +305,7 @@ func (s *Store) realWatch(apiContext *types.APIContext, schema *types.Schema, op
decoder := streaming.NewDecoder(framer, &unstructuredDecoder{})
watcher := watch.NewStreamWatcher(restclientwatch.NewDecoder(decoder, &unstructuredDecoder{}), &errorReporter{})

watchingContext, cancelWatchingContext := context.WithCancel(apiContext.Request.Context())
watchingContext, cancelWatchingContext := context.WithCancel(s.close)
go func() {
<-watchingContext.Done()
logrus.Tracef("stopping watcher for %s", schema.ID)
Expand Down

0 comments on commit 00d3503

Please sign in to comment.