"""Worker stubs for scheduled connector runs.

For production use, wire this module into Celery or RQ. The MVP intentionally avoids
running unattended public crawls until retailer-specific compliance approval is complete.
"""
from app.core.database import SessionLocal
from app.services.public_scraper import scrape_public_page


def run_public_page_job(retailer_name: str, url: str) -> dict:
    db = SessionLocal()
    try:
        return scrape_public_page(db, retailer_name, url)
    finally:
        db.close()
