From 78ce4f9878ac2d8637f5d4e7c03cf0c7819d4c60 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phane=20Brunner?= Date: Wed, 18 Dec 2024 13:57:20 +0100 Subject: [PATCH] Don't store tiles in error --- tilecloud_chain/internal_mapcache.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/tilecloud_chain/internal_mapcache.py b/tilecloud_chain/internal_mapcache.py index 001a114a2..30a52ccb7 100644 --- a/tilecloud_chain/internal_mapcache.py +++ b/tilecloud_chain/internal_mapcache.py @@ -184,11 +184,12 @@ def compute_tile(self, tile: Tile) -> bool: if tile_.error: _LOG.error("Tile %s %s in error: %s", tile_.tilecoord, tile_.formated_metadata, tile_.error) success = False - if tile_.data is None: + elif tile_.data is None: _LOG.error("Tile %s %s in error: no data", tile_.tilecoord, tile_.formated_metadata) success = False - _LOG.debug("Tile %s %s generated", tile_.tilecoord, tile_.formated_metadata) - self._cache_store.put_one(tile_) + else: + _LOG.debug("Tile %s %s generated", tile_.tilecoord, tile_.formated_metadata) + self._cache_store.put_one(tile_) return success @contextlib.contextmanager