From f9ff06b9d4af97612c679d911e17137ac401034e Mon Sep 17 00:00:00 2001 From: Robin Ward Date: Wed, 16 Aug 2017 12:59:21 -0400 Subject: [PATCH] Allow ENV variable to force polling --- lib/stylesheet/watcher.rb | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/lib/stylesheet/watcher.rb b/lib/stylesheet/watcher.rb index 27dbe8f692b..f0778b38dc2 100644 --- a/lib/stylesheet/watcher.rb +++ b/lib/stylesheet/watcher.rb @@ -37,10 +37,14 @@ module Stylesheet end root = Rails.root.to_s + + listener_opts = { ignore: /xxxx/ } + listener_opts[:force_polling] = true if ENV['FORCE_POLLING'] + @paths.each do |watch| Thread.new do begin - listener = Listen.to("#{root}/#{watch}", ignore: /xxxx/) do |modified, added, _| + listener = Listen.to("#{root}/#{watch}", listener_opts) do |modified, added, _| paths = [modified, added].flatten paths.compact! paths.map! { |long| long[(root.length + 1)..-1] }