From f0d0f559b64c7f6635455ad72121d8a8b16b7f8b Mon Sep 17 00:00:00 2001 From: Kaalleen <36401965+kaalleen@users.noreply.github.com> Date: Thu, 9 Jan 2025 17:06:35 +0100 Subject: cache: reset on operational error (#3421) --- lib/utils/cache.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lib/utils') diff --git a/lib/utils/cache.py b/lib/utils/cache.py index 6d51ea08..978782bf 100644 --- a/lib/utils/cache.py +++ b/lib/utils/cache.py @@ -35,7 +35,7 @@ def get_stitch_plan_cache(): size_limit = global_settings['cache_size'] * 1024 * 1024 try: __stitch_plan_cache = diskcache.Cache(cache_dir, size=size_limit) - except sqlite3.DatabaseError: + except (sqlite3.DatabaseError, sqlite3.OperationalError): # reset cache database file if it couldn't parse correctly cache_file = os.path.join(appdirs.user_config_dir('inkstitch'), 'cache', 'stitch_plan', 'cache.db') if os.path.exists(cache_file): -- cgit v1.2.3