Merge pull request #14933 from AUTOMATIC1111/fix/graceful-mtime-hash-cache-exception

Gracefully handle mtime read exception from cache
This commit is contained in:
AUTOMATIC1111 2024-02-17 08:56:48 +03:00 committed by GitHub
commit ce57a6c6db
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -21,7 +21,10 @@ def calculate_sha256(filename):
def sha256_from_cache(filename, title, use_addnet_hash=False):
hashes = cache("hashes-addnet") if use_addnet_hash else cache("hashes")
ondisk_mtime = os.path.getmtime(filename)
try:
ondisk_mtime = os.path.getmtime(filename)
except FileNotFoundError:
return None
if title not in hashes:
return None