mirror of
https://github.com/codeninjasllc/discourse.git
synced 2024-11-27 09:36:19 -05:00
FIX: autospec not monitoring correctly
This commit is contained in:
parent
e53f110c83
commit
29f6d960c6
1 changed files with 14 additions and 7 deletions
|
@ -159,13 +159,20 @@ class Autospec::Manager
|
||||||
path = File.expand_path(File.dirname(__FILE__) + "../../..")
|
path = File.expand_path(File.dirname(__FILE__) + "../../..")
|
||||||
|
|
||||||
# to speed up boot we use a thread
|
# to speed up boot we use a thread
|
||||||
Thread.new do
|
["spec", "lib", "app", "config", "test", "vendor", "plugins"].each do |watch|
|
||||||
["spec", "lib", "app", "config", "test", "vendor", "plugins"].each do |watch|
|
|
||||||
Listen.to("#{path}/#{watch}", options) do |modified, added, _|
|
puts "@@@@@@@@@ Listen to #{path}/#{watch} #{options}" if @debug
|
||||||
paths = [modified, added].flatten
|
Thread.new do
|
||||||
paths.compact!
|
begin
|
||||||
paths.map!{|long| long[(path.length+1)..-1]}
|
Listen.to("#{path}/#{watch}", options) do |modified, added, _|
|
||||||
process_change(paths)
|
paths = [modified, added].flatten
|
||||||
|
paths.compact!
|
||||||
|
paths.map!{|long| long[(path.length+1)..-1]}
|
||||||
|
process_change(paths)
|
||||||
|
end
|
||||||
|
rescue => e
|
||||||
|
puts "FAILED to listen on changes to #{path}/#{watch}"
|
||||||
|
puts e
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in a new issue