Skip to content

Detect same-second file edits when polling - #388

Open
DSeaStar wants to merge 1 commit into
samuelcolvin:mainfrom
DSeaStar:fix-polling-same-second-mtime
Open

Detect same-second file edits when polling#388
DSeaStar wants to merge 1 commit into
samuelcolvin:mainfrom
DSeaStar:fix-polling-same-second-mtime

Conversation

@DSeaStar

Copy link
Copy Markdown

Fixes #319.

notify::PollWatcher keeps mtime as whole seconds, so force_polling=True missed content changes that landed in the same second as the previous scan. Enable compare_contents on the poll watcher so those edits still produce a modified event.

Added a regression test that rewrites a file and then freezes its mtime, which used to be invisible to polling.

notify's PollWatcher only compares mtime at second resolution, so
force_polling missed content changes that landed in the same second.
Hash file contents as well so those edits still produce events.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Missed sub-second updates when using polling

1 participant