diff --git a/base/loading.jl b/base/loading.jl index 81919dfea0770..6df28abbd9dbb 100644 --- a/base/loading.jl +++ b/base/loading.jl @@ -232,12 +232,10 @@ end function get_updated_dict(p::TOML.Parser, f::CachedTOMLDict) s = stat(f.path) - time_since_cached = time() - f.mtime - rough_mtime_granularity = 0.1 # seconds - # In case the file is being updated faster than the mtime granularity, - # and have the same size after the update we might miss that it changed. Therefore - # always check the hash in case we recently created the cache. - if time_since_cached < rough_mtime_granularity || s.inode != f.inode || s.mtime != f.mtime || f.size != s.size + # note, this might miss very rapid in-place updates, such that mtime is + # identical but that is solvable by not doing in-place updates, and not + # rapidly changing these files + if s.inode != f.inode || s.mtime != f.mtime || f.size != s.size content = read(f.path) new_hash = _crc32c(content) if new_hash != f.hash