method
rebuild_watcher
v7.1.3.2 -
Show latest stable
- Class:
ActionView::CacheExpiry::ViewReloader
rebuild_watcher()private
No documentation available.
# File actionview/lib/action_view/cache_expiry.rb, line 36
def rebuild_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