diff options
author | AUTOMATIC1111 <16777216c@gmail.com> | 2023-07-18 15:20:22 +0000 |
---|---|---|
committer | AUTOMATIC1111 <16777216c@gmail.com> | 2023-07-18 15:20:22 +0000 |
commit | eb7c9b58fc2fbab205d4bc9f708800870dcda3fb (patch) | |
tree | 337bc9e4e6793aa072c2e2a8c10e3a3f7daf6a95 /modules/hashes.py | |
parent | f865d3e11647dfd6c7b2cdf90dde24680e58acd8 (diff) | |
parent | 7f7db1700bda40ba3171a49b6a4ef38f868b7d0a (diff) | |
download | stable-diffusion-webui-gfx803-eb7c9b58fc2fbab205d4bc9f708800870dcda3fb.tar.gz stable-diffusion-webui-gfx803-eb7c9b58fc2fbab205d4bc9f708800870dcda3fb.tar.bz2 stable-diffusion-webui-gfx803-eb7c9b58fc2fbab205d4bc9f708800870dcda3fb.zip |
Merge branch 'dev' into release_candidate
Diffstat (limited to 'modules/hashes.py')
-rw-r--r-- | modules/hashes.py | 33 |
1 files changed, 3 insertions, 30 deletions
diff --git a/modules/hashes.py b/modules/hashes.py index 8b7ea0ac..b7a33b42 100644 --- a/modules/hashes.py +++ b/modules/hashes.py @@ -1,38 +1,11 @@ import hashlib
-import json
import os.path
-import filelock
-
from modules import shared
-from modules.paths import data_path
-
-
-cache_filename = os.path.join(data_path, "cache.json")
-cache_data = None
-
-
-def dump_cache():
- with filelock.FileLock(f"{cache_filename}.lock"):
- with open(cache_filename, "w", encoding="utf8") as file:
- json.dump(cache_data, file, indent=4)
-
-
-def cache(subsection):
- global cache_data
-
- if cache_data is None:
- with filelock.FileLock(f"{cache_filename}.lock"):
- if not os.path.isfile(cache_filename):
- cache_data = {}
- else:
- with open(cache_filename, "r", encoding="utf8") as file:
- cache_data = json.load(file)
-
- s = cache_data.get(subsection, {})
- cache_data[subsection] = s
+import modules.cache
- return s
+dump_cache = modules.cache.dump_cache
+cache = modules.cache.cache
def calculate_sha256(filename):
|