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

Gracefully handle mtime read exception from cache
pull/14947/head
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
1 changed files with 4 additions and 1 deletions

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