waiting on file system event don't block process on linux now (guard can be stopped, spec run but don't pass)
This commit is contained in:
parent
2191bc1088
commit
8a63b94247
@ -45,13 +45,16 @@ module Guard
|
||||
|
||||
def watch_change
|
||||
while !@stop
|
||||
inotify.process
|
||||
unless files.empty?
|
||||
files.map! { |file| file.gsub("#{Dir.pwd}/", '') }
|
||||
callback.call(files)
|
||||
files.clear
|
||||
if IO.select([notifier.to_io], [], [], latency)
|
||||
notifier.process
|
||||
|
||||
unless files.empty?
|
||||
files.map! { |file| file.gsub("#{Dir.pwd}/", '') }
|
||||
callback.call(files)
|
||||
files.clear
|
||||
end
|
||||
sleep latency
|
||||
end
|
||||
sleep latency
|
||||
end
|
||||
end
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user