Skip to content

Commit

Permalink
Clear loading errors
Browse files Browse the repository at this point in the history
  • Loading branch information
akariv committed Jun 11, 2024
1 parent d44656a commit e3632fd
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion odds/backend/processor/resource_processor.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -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:
Expand Down

0 comments on commit e3632fd

Please sign in to comment.