summaryrefslogtreecommitdiff
path: root/lib/utils/cache.py
diff options
context:
space:
mode:
authorKaalleen <36401965+kaalleen@users.noreply.github.com>2025-01-09 17:06:35 +0100
committerGitHub <noreply@github.com>2025-01-09 17:06:35 +0100
commitf0d0f559b64c7f6635455ad72121d8a8b16b7f8b (patch)
tree014183ff5e6d5a14cacf23d97c3e20df9193aec2 /lib/utils/cache.py
parentca02ac5b015dd64ebe3d13b8cc2021535a369161 (diff)
cache: reset on operational error (#3421)
Diffstat (limited to 'lib/utils/cache.py')
-rw-r--r--lib/utils/cache.py2
1 files changed, 1 insertions, 1 deletions
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):