mirror of
https://github.com/niusmallnan/steve.git
synced 2025-09-12 13:03:41 +00:00
Fix possible context leaks
This commit is contained in:
@@ -150,6 +150,7 @@ func (c *Collection) startStopTemplate(schemas map[string]*types.APISchema) {
|
||||
|
||||
subCtx, cancel := context.WithCancel(c.ctx)
|
||||
if err := template.Start(subCtx); err != nil {
|
||||
cancel()
|
||||
logrus.Errorf("failed to start schema template: %s", id)
|
||||
continue
|
||||
}
|
||||
|
@@ -182,6 +182,7 @@ 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{}
|
||||
|
Reference in New Issue
Block a user