func (o *SlackBotOptions) WatchActivities() chan struct{} {

	log.Logger().Infof("Watching pipeline activities in namespace %s and slackbot config %s", o.Namespace, o.Name)

	// todo wonder if we should switch to a shared index informer and have just one watch rather than one for each slackbot see https://github.com/jenkins-x-labs/slack/issues/15
	factory := informers.NewSharedInformerFactoryWithOptions(o.JXClient, 0, informers.WithNamespace(o.Namespace))

	informer := factory.Jenkins().V1().PipelineActivities().Informer()

	stopper := make(chan struct{})

	informer.AddEventHandler(cache.ResourceEventHandlerFuncs{
		AddFunc:    o.onObj,
		UpdateFunc: o.onUpdate,
	})

	go informer.Run(stopper)

	return stopper
}
// WatchActivities watches for pipeline activities
WatchActivities watches for pipeline activities
// WatchActivities watches for pipeline activities
func (o *SlackBotOptions) WatchActivities() chan struct{} {
	log.Logger().Infof("Watching pipeline activities in namespace %s and slackbot config %s", o.Namespace, o.Name)
	factory := informers.NewSharedInformerFactoryWithOptions(o.JXClient, 0, informers.WithNamespace(o.Namespace))
	informer := factory.Jenkins().V1().PipelineActivities().Informer()
	stopper := make(chan struct{})
	informer.AddEventHandler(cache.ResourceEventHandlerFuncs{
		AddFunc:    o.onObj,
		UpdateFunc: o.onUpdate,
	})
	go informer.Run(stopper)
	return stopper
}
func ( o * SlackBotOptions ) WatchActivities ( ) chan struct { } { log . Logger ( ) . Infof ( " " , o . Namespace , o . Name ) factory := informers . NewSharedInformerFactoryWithOptions ( o . JXClient , 0 , informers . WithNamespace ( o . Namespace ) ) informer := factory . Jenkins ( ) . V1 ( ) . PipelineActivities ( ) . Informer ( ) stopper := make ( chan struct { } ) informer . AddEventHandler ( cache . ResourceEventHandlerFuncs { AddFunc : o . onObj , UpdateFunc : o . onUpdate , } ) go informer . Run ( stopper ) return stopper }
WatchActivities watches for pipeline activities
WatchActivities watches for pipeline activities
// todo wonder if we should switch to a shared index informer and have just one watch rather than one for each slackbot see https://github.com/jenkins-x-labs/slack/issues/15