lib/fluent/plugin/in_tail.rb in fluentd-1.2.2 vs lib/fluent/plugin/in_tail.rb in fluentd-1.2.3
- old
+ new
@@ -214,23 +214,27 @@
@paths.each { |path|
path = date.strftime(path)
if path.include?('*')
paths += Dir.glob(path).select { |p|
- is_file = !File.directory?(p)
- if File.readable?(p) && is_file
- if @limit_recently_modified && File.mtime(p) < (date - @limit_recently_modified)
- false
+ begin
+ is_file = !File.directory?(p)
+ if File.readable?(p) && is_file
+ if @limit_recently_modified && File.mtime(p) < (date - @limit_recently_modified)
+ false
+ else
+ true
+ end
else
- true
- end
- else
- if is_file
- unless @ignore_list.include?(path)
- log.warn "#{p} unreadable. It is excluded and would be examined next time."
- @ignore_list << path if @ignore_repeated_permission_error
+ if is_file
+ unless @ignore_list.include?(path)
+ log.warn "#{p} unreadable. It is excluded and would be examined next time."
+ @ignore_list << path if @ignore_repeated_permission_error
+ end
end
+ false
end
+ rescue Errno::ENOENT
false
end
}
else
# When file is not created yet, Dir.glob returns an empty array. So just add when path is static.