mirror of
https://github.com/AUTOMATIC1111/stable-diffusion-webui.git
synced 2025-01-17 20:00:12 +08:00
Gracefully handle mtime read exception from cache
This commit is contained in:
parent
b7f45e67dc
commit
6ee4012c0a
@ -21,7 +21,10 @@ def calculate_sha256(filename):
|
|||||||
|
|
||||||
def sha256_from_cache(filename, title, use_addnet_hash=False):
|
def sha256_from_cache(filename, title, use_addnet_hash=False):
|
||||||
hashes = cache("hashes-addnet") if use_addnet_hash else cache("hashes")
|
hashes = cache("hashes-addnet") if use_addnet_hash else cache("hashes")
|
||||||
|
try:
|
||||||
ondisk_mtime = os.path.getmtime(filename)
|
ondisk_mtime = os.path.getmtime(filename)
|
||||||
|
except FileNotFoundError:
|
||||||
|
return None
|
||||||
|
|
||||||
if title not in hashes:
|
if title not in hashes:
|
||||||
return None
|
return None
|
||||||
|
Loading…
Reference in New Issue
Block a user