From 11e25a79a54af473f0e29ee09eb5dd9221b3d84a Mon Sep 17 00:00:00 2001 From: Fabio Manganiello Date: Tue, 22 Oct 2024 00:06:52 +0200 Subject: [PATCH] [CI/CD] Better logic to detect changes in the components cache. --- platypush/plugins/inspect/__init__.py | 2 ++ platypush/plugins/inspect/_cache.py | 4 +++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/platypush/plugins/inspect/__init__.py b/platypush/plugins/inspect/__init__.py index 8fafeadd84..3319ec46a6 100644 --- a/platypush/plugins/inspect/__init__.py +++ b/platypush/plugins/inspect/__init__.py @@ -105,6 +105,8 @@ class InspectPlugin(Plugin): self.logger.info('Saving new components cache to %s', self.cache_file) self._cache.dump(self.cache_file) self._cache.loaded_at = self._cache.saved_at + else: + self.logger.info('No changes detected in the components cache') return self._cache diff --git a/platypush/plugins/inspect/_cache.py b/platypush/plugins/inspect/_cache.py index 9494e1aff3..e479b09e01 100644 --- a/platypush/plugins/inspect/_cache.py +++ b/platypush/plugins/inspect/_cache.py @@ -221,8 +221,10 @@ class Cache: :param obj_type: Object type. :param value: Value to set. """ + old_value = self.get(category, obj_type) self._cache[category][obj_type] = value - self.has_changes = True + if old_value != value: + self.has_changes = True @property def plugins(self) -> Dict[type, dict]: