mirror of
https://github.com/rancher/steve.git
synced 2025-09-17 07:48:52 +00:00
Don't cancel context of subscribe on method exit
This commit is contained in:
@@ -182,7 +182,6 @@ func (r *RBACStore) Watch(apiOp *types.APIRequest, schema *types.APISchema, w ty
|
||||
}
|
||||
|
||||
ctx, cancel := context.WithCancel(apiOp.Context())
|
||||
defer cancel()
|
||||
apiOp = apiOp.WithContext(ctx)
|
||||
|
||||
eg := errgroup.Group{}
|
||||
@@ -218,6 +217,7 @@ func (r *RBACStore) Watch(apiOp *types.APIRequest, schema *types.APISchema, w ty
|
||||
defer close(response)
|
||||
<-ctx.Done()
|
||||
eg.Wait()
|
||||
cancel()
|
||||
}()
|
||||
|
||||
return response, nil
|
||||
|
Reference in New Issue
Block a user