diff options
author | catboxanon <122327233+catboxanon@users.noreply.github.com> | 2024-02-15 18:31:44 +0000 |
---|---|---|
committer | catboxanon <122327233+catboxanon@users.noreply.github.com> | 2024-02-15 18:31:44 +0000 |
commit | 6ee4012c0a4d16fb3a6b2a9ea80a7a4b54073193 (patch) | |
tree | ce32f78a3a81750186fddbf2afcbd716a9ad9369 | |
parent | b7f45e67dcf48914d2f34d4ace977a431a5aa12e (diff) | |
download | stable-diffusion-webui-gfx803-6ee4012c0a4d16fb3a6b2a9ea80a7a4b54073193.tar.gz stable-diffusion-webui-gfx803-6ee4012c0a4d16fb3a6b2a9ea80a7a4b54073193.tar.bz2 stable-diffusion-webui-gfx803-6ee4012c0a4d16fb3a6b2a9ea80a7a4b54073193.zip |
Gracefully handle mtime read exception from cache
-rw-r--r-- | modules/hashes.py | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/modules/hashes.py b/modules/hashes.py index b7a33b42..d22e5fad 100644 --- a/modules/hashes.py +++ b/modules/hashes.py @@ -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
|