diff options
author | 2018-02-05 09:07:24 -0800 | |
---|---|---|
committer | 2018-02-05 09:10:03 -0800 | |
commit | 5a48ecc2f2faf340a66a06fe67b0f200da8de9f3 (patch) | |
tree | 23b3eb6b4f49f020320746b4efbd024974c45ffe /src/main/java/com/google/devtools/build/lib/skyframe/FileStateValue.java | |
parent | f0d3715816ad775089769ee677fc4177f657596b (diff) |
Pass ctime to the TimestampGranularityMonitor
We're now using ctime to detect file changes, so the timestamp granularity monitor should as well.
Unfortunately, we currently get nanosecond ctime from Linux, but then only return millis from FileStatus, so this doesn't change the accuracy of the monitor at all.
PiperOrigin-RevId: 184536539
Diffstat (limited to 'src/main/java/com/google/devtools/build/lib/skyframe/FileStateValue.java')
-rw-r--r-- | src/main/java/com/google/devtools/build/lib/skyframe/FileStateValue.java | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/src/main/java/com/google/devtools/build/lib/skyframe/FileStateValue.java b/src/main/java/com/google/devtools/build/lib/skyframe/FileStateValue.java index 7a3453a243..3d77021213 100644 --- a/src/main/java/com/google/devtools/build/lib/skyframe/FileStateValue.java +++ b/src/main/java/com/google/devtools/build/lib/skyframe/FileStateValue.java @@ -155,11 +155,10 @@ public abstract class FileStateValue implements SkyValue { try { byte[] digest = tryGetDigest(path, stat); if (digest == null) { - long mtime = stat.getLastModifiedTime(); // Note that TimestampGranularityMonitor#notifyDependenceOnFileTime is a thread-safe // method. if (tsgm != null) { - tsgm.notifyDependenceOnFileTime(path.asFragment(), mtime); + tsgm.notifyDependenceOnFileTime(path.asFragment(), stat.getLastChangeTime()); } return new RegularFileStateValue(stat.getSize(), null, FileContentsProxy.create(stat)); } else { @@ -256,10 +255,9 @@ public abstract class FileStateValue implements SkyValue { static SpecialFileStateValue fromStat(PathFragment path, FileStatus stat, @Nullable TimestampGranularityMonitor tsgm) throws IOException { - long mtime = stat.getLastModifiedTime(); // Note that TimestampGranularityMonitor#notifyDependenceOnFileTime is a thread-safe method. if (tsgm != null) { - tsgm.notifyDependenceOnFileTime(path, mtime); + tsgm.notifyDependenceOnFileTime(path, stat.getLastChangeTime()); } return new SpecialFileStateValue(FileContentsProxy.create(stat)); } |