From e3632fd0ce530e2fdcae9752652034cf4244e2d1 Mon Sep 17 00:00:00 2001 From: Adam Kariv Date: Wed, 12 Jun 2024 00:31:19 +0300 Subject: [PATCH] Clear loading errors --- odds/backend/processor/resource_processor.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/odds/backend/processor/resource_processor.py b/odds/backend/processor/resource_processor.py index fb94f12..82f36dd 100644 --- a/odds/backend/processor/resource_processor.py +++ b/odds/backend/processor/resource_processor.py @@ -61,6 +61,8 @@ async def process(self, resource: Resource, dataset: Dataset, catalog: DataCatal if resource.status_loaded and not resource.loading_error: return None resource.status_selected = True + resource.loading_error = None + resource.status_loaded = False to_delete = [] try: async with self.sem: @@ -161,12 +163,14 @@ async def process(self, resource: Resource, dataset: Dataset, catalog: DataCatal resource.status_loaded = True rts.set(ctx, f'SQLITE DATA {resource.url} HAS {resource.row_count} ROWS == {len(data)} ROWS') await store.storeDB(resource, dataset, sqlite_filename, ctx) - rts.clear(ctx) except Exception as e: rts.set(ctx, f'FAILED TO LOAD {resource.url}: {e}', 'error') resource.loading_error = str(e) return + finally: + rts.clear(ctx) + dataset.versions['resource_analyzer'] = config.feature_versions.resource_analyzer finally: for filename in to_delete: