func (w *Watcher) flush() {
	// Stop all the watchers and clear it
	for _, watcher := range w.watchers {
		watcher.StopWatch()
	}

	// Kill everything associated with the watcher
	if w.exitFn != nil {
		w.exitFn()
	}

	w.watchers = make(map[string]*deploymentWatcher, 32)
	w.ctx, w.exitFn = context.WithCancel(context.Background())
	w.evalBatcher = NewEvalBatcher(w.evalBatchDuration, w.raft, w.ctx)
}
// flush is used to clear the state of the watcher
flush is used to clear the state of the watcher
// flush is used to clear the state of the watcher
func (w *Watcher) flush() {
	for _, watcher := range w.watchers {
		watcher.StopWatch()
	}
	if w.exitFn != nil {
		w.exitFn()
	}
	w.watchers = make(map[string]*deploymentWatcher, 32)
	w.ctx, w.exitFn = context.WithCancel(context.Background())
	w.evalBatcher = NewEvalBatcher(w.evalBatchDuration, w.raft, w.ctx)
}
func ( w * Watcher ) flush ( ) { for _ , watcher := range w . watchers { watcher . StopWatch ( ) } if w . exitFn != nil { w . exitFn ( ) } w . watchers = make ( map [ string ] * deploymentWatcher , 32 ) w . ctx , w . exitFn = context . WithCancel ( context . Background ( ) ) w . evalBatcher = NewEvalBatcher ( w . evalBatchDuration , w . raft , w . ctx ) }
flush is used to clear the state of the watcher
flush is used to clear the state of the watcher
// Stop all the watchers and clear it // Kill everything associated with the watcher