Skip to content

Commit dad334f

Browse files
committed
Fixes the problem with read mode and existing sincedb reference
1 parent de5a230 commit dad334f

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

Diff for: lib/filewatch/read_mode/handlers/read_file.rb

+4
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,10 @@ class ReadFile < Base
55
def handle_specifically(watched_file)
66
if open_file(watched_file)
77
add_or_update_sincedb_collection(watched_file) unless sincedb_collection.member?(watched_file.sincedb_key)
8+
if sincedb_collection.member?(watched_file.sincedb_key)
9+
previous_pos = sincedb_collection.find(watched_file).position
10+
watched_file.file_seek([watched_file.bytes_read, previous_pos].max)
11+
end
812
loop do
913
break if quit?
1014
loop_control = watched_file.loop_control_adjusted_for_stat_size

0 commit comments

Comments
 (0)