jordansissel/ruby-filewatch — pull request #24 by buckelij (2013-12-26 15:59:13+00:00)
Title: on EOF, check if sincedb should be written

I was expecting that if :sincedb_write_interval had passed before the tail was shut down, the sincedb would be up-to-date. In fact, up to :sincedb_write_interval worth of writes will be re-read on restart:

#start
echo a > log.txt
sleep $sincedb_write_interval
echo b > log.txt #causes _sincedb_write
echo c > log.txt
#wait a minute (longer than :sincedb_write_interval)
pkill -f /usr/bin/ruby.*test.rb
#on restart, 'c' will be re-read.

This patch checks if :sincedb_write_interval has passed if at EOF.