diff --git a/rf4_research/community_cli.py b/rf4_research/community_cli.py index 71fc71f..76a61e3 100644 --- a/rf4_research/community_cli.py +++ b/rf4_research/community_cli.py @@ -275,9 +275,8 @@ def main(argv: list[str] | None = None) -> int: url = args.url or default_url try: site_key = fetch_site_key(url) - enforce_fetch_interval(site_key, state_file=args.state_file) - # Reserve before network I/O: failed attempts count toward the limit too. - mark_fetch(site_key, state_file=args.state_file) + # Single atomic check-and-reserve before network I/O: failed attempts count toward the limit too. + check_and_reserve(site_key, state_file=args.state_file) html = fetch_html(url) records = (parse(html, source_url=url) if args.source in DETAIL_SOURCES else parse(html))[:args.limit] except Exception as exc: