From 0f57188a2cef254658e8acb324a4b1d315fcefbf Mon Sep 17 00:00:00 2001 From: Adam Miller Date: Tue, 15 Apr 2025 14:03:15 -0700 Subject: [PATCH] refactor: short circuit claimable sites loop when we have enough sites --- brozzler/frontier.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/brozzler/frontier.py b/brozzler/frontier.py index b199c1c..2c872d8 100644 --- a/brozzler/frontier.py +++ b/brozzler/frontier.py @@ -65,6 +65,9 @@ def filter_claimable_site_ids( if is_claimable: claimable_sites.append(site) + if len(claimable_sites) >= max_sites_to_claim: + break + site_ids_to_claim = [] # gather sites that are under the max without going over for site in claimable_sites: