Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Optionally add a time.sleep after each backscraper request #4564

Open
grossir opened this issue Oct 11, 2024 · 1 comment
Open

Optionally add a time.sleep after each backscraper request #4564

grossir opened this issue Oct 11, 2024 · 1 comment

Comments

@grossir
Copy link
Contributor

grossir commented Oct 11, 2024

Some backscrapes make a lot of requests, and this may cause the source server to temporarily block us or to be overloaded.

We could handle this by introducing a time.sleep(backscrape_wait) after each backscrape tick, where backscrape_wait has a default of 1 (?) and is configurable via command line argument.

For example, the following command would override the wait to be of 60 seconds after each backscrape tick

manage.py cl_back_scrape_opinions --courts juriscraper.opinions.united_states.state.ortc --backscrape-start 2011/12/14 --verbosity 3 --backscrape-wait=60

for site in site_yielder(
mod.Site(
backscrape_start=options.get("backscrape_start"),
backscrape_end=options.get("backscrape_end"),
).back_scrape_iterable,
mod,
):
site.parse()
self.scrape_court(site, full_crawl=True)

Copy link

sentry-io bot commented Oct 15, 2024

Sentry Issue: COURTLISTENER-8CP

An instance of this server failure after a couple of backscrape ticks...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant