提交 f783f43b 编写于 作者: W w-e-w

fix calculate_addnet_hash_sqlite3

上级 25d760ee
......@@ -156,6 +156,7 @@ def cached_data_for_file(subsection, title, filename, func):
conn.execute(insert_or_replace, (title, ondisk_mtime, json.dumps(value)))
existing_cache = cache(subsection)
existing_cache[title] = {'mtime': ondisk_mtime, 'value': value}
print(f'{title}: {value}')
return value
except Exception as e:
print(e)
......
......@@ -40,7 +40,7 @@ def sha256(filename, title, use_addnet_hash=False):
if use_addnet_hash:
def calculate_addnet_hash_sqlite3():
with open(filename, "rb") as file:
return {addnet_hash_safetensors(file)}
return addnet_hash_safetensors(file)
return modules.cache.cached_data_for_file("hashes-addnet", title, filename, calculate_addnet_hash_sqlite3)
else:
def calculate_sha256_sqlite3():
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册