From 9aa9ecdc0a90161e4ea407dc03e5c1ba89cf43f8 Mon Sep 17 00:00:00 2001 From: Victor Shyba Date: Thu, 21 Jul 2022 15:52:19 -0300 Subject: [PATCH] add arg for db path --- scripts/dht_crawler.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/scripts/dht_crawler.py b/scripts/dht_crawler.py index d35ee7216..64261f007 100644 --- a/scripts/dht_crawler.py +++ b/scripts/dht_crawler.py @@ -1,3 +1,4 @@ +import sys import datetime import logging import asyncio @@ -457,12 +458,13 @@ def dict_row_factory(cursor, row): async def test(): + db_path = "/tmp/peers.db" if len(sys.argv) == 1 else sys.argv[-1] asyncio.get_event_loop().set_debug(True) metrics = SimpleMetrics('8080') await metrics.start() conf = Config() hosting_samples = SDHashSamples("test.sample") if os.path.isfile("test.sample") else None - crawler = Crawler("/tmp/a.db", hosting_samples) + crawler = Crawler(db_path, hosting_samples) await crawler.open() await crawler.flush_to_db() await crawler.node.start_listening()