Give option for only crawling some boards

This commit is contained in:
Mark Veidemanis 2022-12-22 07:20:26 +00:00
parent ebaf8c765d
commit 0ab67becff
Signed by: m
GPG Key ID: 5ACFCEED46C0904F
1 changed files with 7 additions and 1 deletions

View File

@ -25,6 +25,9 @@ CRAWL_DELAY = int(getenv("MONOLITH_CH4_CRAWL_DELAY", 5))
# Semaphore value ?
THREADS_SEMAPHORE = int(getenv("MONOLITH_CH4_THREADS_SEMAPHORE", 1000))
# Boards to crawl
BOARDS = getenv("MONOLITH_CH4_BOARDS", "").split(",")
# CONFIGURATION END #
@ -58,7 +61,10 @@ class Chan4(object):
self.log.debug(f"Decoded hash key: {self.hash_key}")
async def run(self):
await self.get_board_list()
if not BOARDS:
await self.get_board_list()
else:
self.boards = BOARDS
while True:
await self.get_thread_lists(self.boards)
await asyncio.sleep(CRAWL_DELAY)