class ActionView::CacheExpiry::ViewReloader

def build_watcher

def build_watcher
  @mutex.synchronize do
    old_watcher = @watcher
    if @watched_dirs != dirs_to_watch
      @watched_dirs = dirs_to_watch
      new_watcher = @watcher_class.new([], @watched_dirs) do
        reload!
      end
      @watcher = new_watcher
      # We must check the old watcher after initializing the new one to
      # ensure we don't miss any events
      @previous_change ||= old_watcher&.updated?
    end
  end
end