Skip to content

armgit / mwmbl

Public Imported from GitHub
0

An open source, non-profit web search engine

enh: add check for crawler worker value

thiswillbeyourgithubc1dfd0f830dd
diff --git a/mwmbl/crawl.py b/mwmbl/crawl.py
index 06813a3..c7836d5 100644
--- a/mwmbl/crawl.py
+++ b/mwmbl/crawl.py
@@ -43,7 +43,8 @@ url_queue = RedisURLQueue(redis, lambda: set())
def run():
- workers = CRAWLER_WORKERS
+ workers: int = CRAWLER_WORKERS
+ assert workers > 0, f"Invalid value for CRAWLER_WORKERS: {workers}"
batch_processes: list[Process] = []
for i in range(workers):