An open source, non-profit web search engine
Handle a bad batch
Daoud Clarke91269d510029
diff --git a/mwmbl/indexer/batch_cache.py b/mwmbl/indexer/batch_cache.pyindex 3001e81..e7af6db 100644--- a/mwmbl/indexer/batch_cache.py+++ b/mwmbl/indexer/batch_cache.py@@ -39,7 +39,11 @@ class BatchCache:except FileNotFoundError:logger.exception(f"Missing batch file: {path}")continue- batch = HashedBatch.parse_raw(data)+ try:+ batch = HashedBatch.parse_raw(data)+ except ValidationError:+ logger.exception(f"Unable to parse batch, skipping: '{data}'")+ continuebatches[url] = batchreturn batches