mirror of
https://github.com/discourse/discourse.git
synced 2025-03-23 14:59:16 +08:00
Allow ENV variable to force polling
This commit is contained in:
parent
0daeefc977
commit
f9ff06b9d4
@ -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] }
|
||||
|
Loading…
x
Reference in New Issue
Block a user