Skip to content

Commit

Permalink
derive cache context from context.Background()
Browse files Browse the repository at this point in the history
Signed-off-by: everettraven <everettraven@gmail.com>
  • Loading branch information
everettraven committed Jul 10, 2024
1 parent ef5558b commit 0999fb2
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions internal/contentmanager/contentmanager.go
Original file line number Diff line number Diff line change
Expand Up @@ -176,21 +176,21 @@ func (i *instance) Watch(ctx context.Context, ctrl controller.Controller, ce *v1
data.Cancel()
}

ctx, cancel := context.WithCancel(ctx)
cacheCtx, cancel := context.WithCancel(context.Background())
i.extensionCaches[ce.Name] = extensionCacheData{
Cache: c,
Cancel: cancel,
}
i.mu.Unlock()

go func() {
err := c.Start(ctx)
err := c.Start(cacheCtx)
if err != nil {
i.Unwatch(ce)
}
}()

if !c.WaitForCacheSync(ctx) {
if !c.WaitForCacheSync(cacheCtx) {
i.Unwatch(ce)
return errors.New("cache could not sync, it has been stopped and removed")
}
Expand Down

0 comments on commit 0999fb2

Please sign in to comment.