aboutsummaryrefslogtreecommitdiffstats
path: root/modules/hashes.py
diff options
context:
space:
mode:
authorAUTOMATIC1111 <16777216c@gmail.com>2023-07-25 05:18:02 +0000
committerAUTOMATIC1111 <16777216c@gmail.com>2023-07-25 05:18:02 +0000
commita3ddf464a2ed24c999f67ddfef7969f8291567be (patch)
treecf70006b4d1d6df1f42ea944416b1034ae32a92b /modules/hashes.py
parentf865d3e11647dfd6c7b2cdf90dde24680e58acd8 (diff)
parent2c11e9009ea18bab4ce2963d44db0c6fd3227370 (diff)
downloadstable-diffusion-webui-gfx803-a3ddf464a2ed24c999f67ddfef7969f8291567be.tar.gz
stable-diffusion-webui-gfx803-a3ddf464a2ed24c999f67ddfef7969f8291567be.tar.bz2
stable-diffusion-webui-gfx803-a3ddf464a2ed24c999f67ddfef7969f8291567be.zip
Merge branch 'release_candidate'
Diffstat (limited to 'modules/hashes.py')
-rw-r--r--modules/hashes.py33
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):