mirror of
https://github.com/discourse/discourse.git
synced 2025-03-25 02:15:32 +08:00
Allow ENV variable to force polling
This commit is contained in:
parent
0daeefc977
commit
f9ff06b9d4
@ -37,10 +37,14 @@ module Stylesheet
|
|||||||
end
|
end
|
||||||
|
|
||||||
root = Rails.root.to_s
|
root = Rails.root.to_s
|
||||||
|
|
||||||
|
listener_opts = { ignore: /xxxx/ }
|
||||||
|
listener_opts[:force_polling] = true if ENV['FORCE_POLLING']
|
||||||
|
|
||||||
@paths.each do |watch|
|
@paths.each do |watch|
|
||||||
Thread.new do
|
Thread.new do
|
||||||
begin
|
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 = [modified, added].flatten
|
||||||
paths.compact!
|
paths.compact!
|
||||||
paths.map! { |long| long[(root.length + 1)..-1] }
|
paths.map! { |long| long[(root.length + 1)..-1] }
|
||||||
|
Loading…
x
Reference in New Issue
Block a user