1
0
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:
smallteeths
2021-06-29 10:22:11 +08:00
parent dcaaf9498d
commit 0bb78cf76b

View File

@@ -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