A bunch of changes

This commit is contained in:
Ignacio Serantes
2026-03-24 09:06:37 +01:00
parent 144ad665e4
commit 20e5318a53
4 changed files with 518 additions and 135 deletions

View File

@@ -44,7 +44,11 @@ from imageviewer import ImageViewer
from metadatamanager import XattrManager
if HAVE_BAGHEERASEARCH_LIB:
from bagheera_search_lib import BagheeraSearcher
try:
from bagheera_search_lib import BagheeraSearcher
except ImportError:
HAVE_BAGHEERASEARCH_LIB = False
pass
# Set up logging for better debugging
logger = logging.getLogger(__name__)
@@ -371,11 +375,8 @@ class CacheWriter(QThread):
# Gather a batch of items
# Adaptive batch size: if queue is backing up, increase transaction size
# to improve throughput.
if not self._running:
# Flush everything if stopping
batch_limit = len(self._queue)
else:
batch_limit = self._max_size
# Respect max size even during shutdown to avoid OOM or huge transactions
batch_limit = self._max_size
batch = []
while self._queue and len(batch) < batch_limit: