From 1f50076bb83af6126206a38c67e89df0ccf07425 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Wed, 5 May 2021 21:52:13 +0530 Subject: [PATCH] When trying to upgrade a shared lock a LockingError is raised not a DowngradeError --- src/calibre/db/cache.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/calibre/db/cache.py b/src/calibre/db/cache.py index 2af054656d..ca3b316b4f 100644 --- a/src/calibre/db/cache.py +++ b/src/calibre/db/cache.py @@ -28,7 +28,7 @@ from calibre.db.categories import get_categories from calibre.db.errors import NoSuchBook, NoSuchFormat from calibre.db.fields import IDENTITY, InvalidLinkTable, create_field from calibre.db.lazy import FormatMetadata, FormatsList, ProxyMetadata -from calibre.db.locking import DowngradeLockError, SafeReadLock, create_locks +from calibre.db.locking import LockingError, DowngradeLockError, SafeReadLock, create_locks from calibre.db.search import Search from calibre.db.tables import VirtualTable from calibre.db.utils import type_safe_sort_key_function @@ -688,7 +688,7 @@ class Cache(object): try: with self.write_lock: self.clear_composite_caches() - except DowngradeLockError: + except LockingError: # We can't clear the composite caches because a read lock is set. # As a consequence the value of a composite column that calls # virtual_libraries() might be wrong. Oh well. Log and keep running.