Skip to content

Commit 8d7243e

Browse files
author
Lucas Pires
committed
fix create_if_deleted logic by closing the file handle, fix #81
1 parent fd1f296 commit 8d7243e

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

lib/logstash/outputs/file.rb

+2-2
Original file line numberDiff line numberDiff line change
@@ -246,8 +246,8 @@ def open(path)
246246

247247
if deleted?(path)
248248
if @create_if_deleted
249-
@logger.debug("Required path was deleted, creating the file again", :path => path)
250-
@files.delete(path)
249+
@logger.debug("Required path was deleted, creating the file again, and releasing old handle", :path => path)
250+
@files.delete(path).close if cached?(path)
251251
else
252252
return @files[path] if cached?(path)
253253
end

0 commit comments

Comments
 (0)