From 5588623c6f59699266199fe4c985e8983aa5874e Mon Sep 17 00:00:00 2001 From: Jameson Nash Date: Thu, 29 Sep 2022 08:53:32 +0200 Subject: [PATCH] remove bad test from get_updated_dict (#46944) PR #42328 (21ebabf7904061b4283b4428efa8fa4d6e8d0bc6) already fixed issue #35217 by removing the bad test. Now also remove the nonsensical comment condition from loading.jl. --- base/loading.jl | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) 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