From f2d12833a6c7652c96e116eae99c55dfd1fc6d8c Mon Sep 17 00:00:00 2001 From: Blottiere Paul Date: Fri, 20 Sep 2024 15:57:25 +0200 Subject: [PATCH] Clear legends cache --- qsa-api/qsa_api/mapproxy/mapproxy.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/qsa-api/qsa_api/mapproxy/mapproxy.py b/qsa-api/qsa_api/mapproxy/mapproxy.py index 72e7533..9535145 100644 --- a/qsa-api/qsa_api/mapproxy/mapproxy.py +++ b/qsa-api/qsa_api/mapproxy/mapproxy.py @@ -84,10 +84,14 @@ def clear_cache(self, layer_name: str) -> None: bucket.objects.filter(Prefix=cache_dir).delete() else: cache_dir = self._mapproxy_project.parent / "cache_data" - self.debug(f"Clear cache '{cache_dir}'") + self.debug(f"Clear tiles cache '{cache_dir}'") for d in cache_dir.glob(f"{layer_name}_cache_*"): shutil.rmtree(d) + cache_dir = self._mapproxy_project.parent / "cache_data" / "legends" + self.debug(f"Clear legends cache '{cache_dir}'") + shutil.rmtree(cache_dir, ignore_errors=True) + def add_layer( self, name: str,