Skip to content
Snippets Groups Projects
Verified Commit 3235ac5f authored by Eliot Berriot's avatar Eliot Berriot
Browse files

Added CLI to poll all domains

parent 9d342176
No related branches found
No related tags found
No related merge requests found
......@@ -92,7 +92,7 @@ async def launch_domain_poll(pool, session, domain):
@cli.command()
@click.argument("domain", type=str, nargs=-1, required=True)
@click.argument("domain", type=str, nargs=-1)
@async_command
async def poll(domain):
"""
......@@ -101,8 +101,16 @@ async def poll(domain):
from . import crawler
from . import db
from . import settings
from . import worker
pool = await db.get_pool(settings.DB_DSN)
if not domain:
click.echo("Polling all domains…")
crawler = worker.Crawler(
redis_settings=arq.RedisSettings(**settings.REDIS_CONFIG)
)
return await crawler.poll_all()
try:
kwargs = crawler.get_session_kwargs()
async with aiohttp.ClientSession(**kwargs) as session:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment