From c62564a1d4b2eafe8820df3b574f6c544af4fc17 Mon Sep 17 00:00:00 2001 From: Stig Ofstad Date: Mon, 16 Dec 2024 09:05:37 +0100 Subject: [PATCH] fix: invalidate BP cache on blueprint updates --- src/common/providers/blueprint_provider.py | 1 + src/services/document_service/document_service.py | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/src/common/providers/blueprint_provider.py b/src/common/providers/blueprint_provider.py index 24d8576a..6609a531 100644 --- a/src/common/providers/blueprint_provider.py +++ b/src/common/providers/blueprint_provider.py @@ -116,6 +116,7 @@ def get_blueprint(self, type: str) -> Blueprint: def invalidate_cache(self): try: logger.debug("invalidate cache") + self.prefetched_blueprints = {} self.get_blueprint.cache_clear() self.get_blueprint_with_extended_attributes.cache_clear() except Exception as error: diff --git a/src/services/document_service/document_service.py b/src/services/document_service/document_service.py index dbfb002a..7fbe3aaa 100644 --- a/src/services/document_service/document_service.py +++ b/src/services/document_service/document_service.py @@ -74,7 +74,7 @@ def get_storage_recipes(self, type: str, context: str | None = None) -> list[Sto return create_default_storage_recipe() def invalidate_cache(self): - pass + self._blueprint_provider.invalidate_cache() def save_blob_data(self, node: Node, repository: DataSource) -> dict: """