From df2dd194cca115f92274cb1c4bbb66f0ef2282e9 Mon Sep 17 00:00:00 2001 From: Manuel Schmid Date: Mon, 1 Jul 2024 17:54:20 +0200 Subject: [PATCH] feat: only use hash cache logs for exceptions --- modules/config.py | 2 ++ modules/hash_cache.py | 4 +--- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/modules/config.py b/modules/config.py index 2f958ff6..e9e6b1cf 100644 --- a/modules/config.py +++ b/modules/config.py @@ -762,12 +762,14 @@ if args_manager.args.rebuild_hash_cache: from modules.hash_cache import sha256_from_cache from modules.util import get_file_from_folder_list + print('[Cache] Rebuilding hash cache') for filename in model_filenames: filepath = get_file_from_folder_list(filename, paths_checkpoints) sha256_from_cache(filepath) for filename in lora_filenames: filepath = get_file_from_folder_list(filename, paths_loras) sha256_from_cache(filepath) + print('[Cache] Done') # write cache to file again for sorting and cleanup of invalid cache entries save_cache_to_file() diff --git a/modules/hash_cache.py b/modules/hash_cache.py index b2117ae9..10566560 100644 --- a/modules/hash_cache.py +++ b/modules/hash_cache.py @@ -30,9 +30,8 @@ def load_cache_from_file(): print(f'[Cache] Skipping invalid cache entry: {filepath}') continue hash_cache[filepath] = hash_value - print(f'[Cache] Warmed cache from file') except Exception as e: - print(f'[Cache] Warming failed: {e}') + print(f'[Cache] Loading failed: {e}') def save_cache_to_file(filename=None, hash_value=None): @@ -50,6 +49,5 @@ def save_cache_to_file(filename=None, hash_value=None): for filepath, hash_value in items: json.dump({filepath: hash_value}, fp) fp.write('\n') - print(f'[Cache] Updated cache file') except Exception as e: print(f'[Cache] Saving failed: {e}')