Does logstash update the .sincedb file after a log file is completely read or during the reading process?

Does Logstash update the .sincedb file after a log file is read till the end or during the reading process ?

For example:
Let's say there is directory which is being monitored by Logstash. A file [say file1.log with max offset (file size) as 10000 ] is copied into this directory.

Does .sincedb file gets updated/created (if not already present) with the info of file1.log when the Logstash reaches offset 10000 ?

What I think is logstash should update the .sincedb file on regular basis, but what I have noticed is that it gets updated/created after a file is completely read.