From 8b8f73f31756f9f8088cb910d7170c8b035ba5a4 Mon Sep 17 00:00:00 2001 From: Benjamin Ooghe-Tabanou Date: Mon, 17 May 2021 12:39:26 +0200 Subject: [PATCH] handle rare race condition on corpus closure --- hyphe_backend/core.tac | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hyphe_backend/core.tac b/hyphe_backend/core.tac index 0eddc748..c01ecb8d 100644 --- a/hyphe_backend/core.tac +++ b/hyphe_backend/core.tac @@ -2197,7 +2197,7 @@ class Memory_Structure(customJSONRPC): s = time.time() # Build links after at least one index if no more than 25000 pages in queue and... pages_crawled = yield self.db.check_pages(corpus) - if pages_crawled and self.corpora[corpus]['recent_changes'] and self.corpora[corpus]['pages_queued'] < 25000 and ( + if pages_crawled and corpus in self.corpora and self.corpora[corpus]['recent_changes'] and self.corpora[corpus]['pages_queued'] < 25000 and ( # pagesqueue is empty not self.corpora[corpus]['pages_queued'] or # links were not built since more than 8 times the time it takes