Commit 25d760ee authored by w-e-w's avatar w-e-w
Browse files

refresh cache when modification time not equal

parent df7aa28b
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -140,7 +140,7 @@ def cached_data_for_file(subsection, title, filename, func):
    entry = existing_cache.get(title)
    if entry:
        cached_mtime = entry.get("mtime", 0)
        if ondisk_mtime > cached_mtime:
        if ondisk_mtime != cached_mtime:
            entry = None

    if not entry or 'value' not in entry:
+1 −1
Original line number Diff line number Diff line
@@ -29,7 +29,7 @@ def sha256_from_cache(filename, title, use_addnet_hash=False):
    cached_sha256 = hashes[title].get("value" if shared.opts.experimental_sqlite_cache else "sha256", None)
    cached_mtime = hashes[title].get("mtime", 0)

    if ondisk_mtime > cached_mtime or cached_sha256 is None:
    if ondisk_mtime != cached_mtime or cached_sha256 is None:
        return None

    return cached_sha256