diff --git a/server.py b/server.py index 28510f2..288ed78 100644 --- a/server.py +++ b/server.py @@ -121,8 +121,9 @@ if Path.cwd() == Path("/app"): CACHE_DIR = Path("/app/cache") else: CACHE_DIR = Path(appdirs.user_cache_dir("matrix-url-preview")) +CACHE_DIR.mkdir(parents=True, exist_ok=True) CACHE_FILE = CACHE_DIR / "db.sqlite3" -CACHE_FILE.touch() +CACHE_FILE.touch(exist_ok=True) logging.debug("Cache file: %r", CACHE_FILE)