[CI/CD] Better logic to detect changes in the components cache.

This commit is contained in:
Fabio Manganiello 2024-10-22 00:06:52 +02:00
parent e73872b65e
commit 11e25a79a5
Signed by untrusted user: blacklight
GPG key ID: D90FBA7F76362774
2 changed files with 5 additions and 1 deletions

View file

@ -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

View file

@ -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]: