A bunch of changes
This commit is contained in:
@@ -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:
|
||||
|
||||
Reference in New Issue
Block a user