Skip to content

Commit

Permalink
rmq_url to actor
Browse files Browse the repository at this point in the history
  • Loading branch information
Florian Briegel committed Jul 6, 2022
1 parent a7d40ad commit 7a50350
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions python/lvmscraper/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,17 +17,25 @@
type=click.Path(exists=True, dir_okay=False),
help="Path to the user configuration file.",
)
@click.option(
"-r",
"--rmqurl",
"rmq_url",
default=None,
type=str,
help="rabbitmq url, eg: amqp://guest:guest@localhost:5672/",
)
@click.option(
"-v",
"--verbose",
count=True,
help="Debug mode. Use additional v for more details.",
)
@click.pass_context
def scraper(ctx, config_file, verbose):
def scraper(ctx, config_file, rmq_url, verbose):
"""scraper controller"""

ctx.obj = {"verbose": verbose, "config_file": config_file}
ctx.obj = {"config_file": config_file, "rmq_url": rmq_url, "verbose": verbose }


@scraper.group(cls=DaemonGroup, prog="scraper_actor", workdir=os.getcwd())
Expand All @@ -40,7 +48,7 @@ async def actor(ctx):
config_file = ctx.obj["config_file"] or default_config_file

print(f"{config_file}")
scraper_obj = ScraperActor.from_config(config_file, verbose=ctx.obj["verbose"])
scraper_obj = ScraperActor.from_config(config_file, url=ctx.obj["rmq_url"], verbose=ctx.obj["verbose"])

await scraper_obj.start()
await scraper_obj.run_forever()
Expand Down

0 comments on commit 7a50350

Please sign in to comment.