From fdc9ff8c87a99903f45c0dd6f3898f81bb5dcbe8 Mon Sep 17 00:00:00 2001 From: Jon Pentland Date: Mon, 27 Feb 2023 11:56:22 +0000 Subject: [PATCH 1/2] Don't carry out queue processing activities if the addon is not installed --- src/collective/elasticsearch/queueprocessor.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/collective/elasticsearch/queueprocessor.py b/src/collective/elasticsearch/queueprocessor.py index f0bffb2..e476ef0 100644 --- a/src/collective/elasticsearch/queueprocessor.py +++ b/src/collective/elasticsearch/queueprocessor.py @@ -89,6 +89,8 @@ def _uuid_path(self, obj): def index(self, obj, attributes=None): """Index the specified attributes for an obj.""" + if not self.manager.active: + return actions = self.actions uuid, path = self._uuid_path(obj) actions.uuid_path[uuid] = path @@ -122,10 +124,14 @@ def index(self, obj, attributes=None): def reindex(self, obj, attributes=None, update_metadata=False): """Reindex the specified attributes for an obj.""" + if not self.manager.active: + return self.index(obj, attributes) def unindex(self, obj): """Unindex the obj.""" + if not self.manager.active: + return actions = self.actions uuid, path = self._uuid_path(obj) actions.uuid_path[uuid] = path From eeba00e27e92211b968d46c72284d006b98be8b6 Mon Sep 17 00:00:00 2001 From: Jon Pentland Date: Wed, 1 Mar 2023 11:58:38 +0000 Subject: [PATCH 2/2] Add changelog --- CHANGELOG.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 6c7fa5d..b84f025 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -14,6 +14,8 @@ - Handle negative term filters (fixes #101) @instification +- Check addon is installed before processing queue (fixes #108) @instification + ## 5.0.0 (2022-10-11) - Rename `master` branch to `main` @ericof