fixed initializing chache db at non existent folder

This commit is contained in:
Hazel Noack 2025-07-14 11:37:07 +02:00
parent 04e3d8f29f
commit 332179eb66

View File

@ -30,10 +30,10 @@ def set_cache_directory(cache_directory: Optional[Union[str, Path]] = None):
if cache_directory is not None:
CACHE_DIRECTORY = cache_directory
DB_FILE = Path(CACHE_DIRECTORY, "cache_metadata.db")
_init_db()
print(CACHE_DIRECTORY, DB_FILE)
print(f"initializing cache at {CACHE_DIRECTORY} and db as {DB_FILE}")
Path(CACHE_DIRECTORY).mkdir(exist_ok=True, parents=True)
_init_db()
def get_url_hash(url: str) -> str: