Skip to content

Commit

Permalink
Merge pull request #60 from datamade/bugfix/59-time-limit
Browse files Browse the repository at this point in the history
Add time limit to nightly scrape
  • Loading branch information
antidipyramid authored May 8, 2024
2 parents 78d320a + 7cdcfcd commit c603368
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
year=$(shell date +%Y)

.PHONY: all
all: upload

Expand Down Expand Up @@ -53,11 +55,11 @@ civil-%.jl: cases.db
START=$$(sqlite-utils query --csv --no-headers cases.db \
"$(CIVIL_SCRAPE_START_QUERY)" -p subdivision $*); \
echo $$START; \
scrapy crawl civil -a division=$* -a start=$$START -O $@;
scrapy crawl civil -s CLOSESPIDER_TIMEOUT=3600 -a year=$(year) -a division=$* -a start=$$START -O $@;

chancery.jl: cases.db
START=$$(sqlite3 cases.db < scripts/nightly_chancery_start.sql); \
scrapy crawl chancery -a start=$$START -O $@;
scrapy crawl chancery -a year=$(year) -a start=$$START -O $@;

cases.db :
sqlite3 $@ < scripts/initialize_db.sql
Expand Down

0 comments on commit c603368

Please sign in to comment.