Give option for only crawling some boards
This commit is contained in:
parent
ebaf8c765d
commit
0ab67becff
|
@ -25,6 +25,9 @@ CRAWL_DELAY = int(getenv("MONOLITH_CH4_CRAWL_DELAY", 5))
|
||||||
# Semaphore value ?
|
# Semaphore value ?
|
||||||
THREADS_SEMAPHORE = int(getenv("MONOLITH_CH4_THREADS_SEMAPHORE", 1000))
|
THREADS_SEMAPHORE = int(getenv("MONOLITH_CH4_THREADS_SEMAPHORE", 1000))
|
||||||
|
|
||||||
|
# Boards to crawl
|
||||||
|
BOARDS = getenv("MONOLITH_CH4_BOARDS", "").split(",")
|
||||||
|
|
||||||
# CONFIGURATION END #
|
# CONFIGURATION END #
|
||||||
|
|
||||||
|
|
||||||
|
@ -58,7 +61,10 @@ class Chan4(object):
|
||||||
self.log.debug(f"Decoded hash key: {self.hash_key}")
|
self.log.debug(f"Decoded hash key: {self.hash_key}")
|
||||||
|
|
||||||
async def run(self):
|
async def run(self):
|
||||||
|
if not BOARDS:
|
||||||
await self.get_board_list()
|
await self.get_board_list()
|
||||||
|
else:
|
||||||
|
self.boards = BOARDS
|
||||||
while True:
|
while True:
|
||||||
await self.get_thread_lists(self.boards)
|
await self.get_thread_lists(self.boards)
|
||||||
await asyncio.sleep(CRAWL_DELAY)
|
await asyncio.sleep(CRAWL_DELAY)
|
||||||
|
|
Loading…
Reference in New Issue