Skip to content
Snippets Groups Projects
Commit a15d0d77 authored by Duncan Coutts's avatar Duncan Coutts
Browse files

FileMonitor: handle changes during an update action

If we take the snapshot after the action has completed then we have a
problem. The problem is that files might have changed while the action
was running but /after/ the action read them. If we take the snapshot
after the action completes then we will miss these changes.

The solution is to record a timestamp before beginning execution of the
action and then we make the conservative assumption that any file that
has changed since then has already changed, ie the file monitor state
for these files will be such that checkFileMonitorChanged will report
that they have changed.

Makes use of this in the Rebuild monad so everything using this will get
the feature for free. Also adds a test.

Changed the representation of files that have already changed by the
time we take the snapshot. We had two extra constructor, but now instead
we represent it with the normal constructors but with a Maybe ModTime.
The reason is that it's easier to extend to the globbing case.
parent 1cc71dba
No related branches found
No related tags found
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment