Add informers and internal go routines in manager (#2870)
* used manager's Add function in more places * exit when ctx.Done is received in archivePruner go routines * fix manager tests * fix data race * added more gpm function in manager and removed manager from a util function * closed unused channel and stopped ticker after context is done * added log statements * used context.Done inside function instead of stopper channel
This commit is contained in:
@@ -86,7 +86,9 @@ func (mqt *MessageQueueTriggerManager) Run(ctx context.Context, mgr manager.Inte
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
go informer.Run(ctx.Done())
|
||||
mgr.Add(ctx, func(ctx context.Context) {
|
||||
informer.Run(ctx.Done())
|
||||
})
|
||||
if ok := k8sCache.WaitForCacheSync(ctx.Done(), informer.HasSynced); !ok {
|
||||
mqt.logger.Fatal("failed to wait for caches to sync")
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user