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

File processed flag #306

Merged
merged 3 commits into from
Oct 14, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -123,3 +123,4 @@ Sessionx.vim
*~
tags
[._]*.un~
querido-diario.db
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ run_spider:
docker-compose run --rm processing bash -c "cd data_collection && scrapy crawl $(SPIDER)"

sql:
docker-compose run --rm postgres psql --username gazette -h postgres -W
docker-compose run --rm processing sqlite3 data_collection/querido-diario.db

clean:
find ./data/* -type d -exec rm -rv {} \;
Expand Down
2 changes: 1 addition & 1 deletion processing/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ ADD http://archive.apache.org/dist/tika/tika-app-1.24.jar /tika-app.jar

RUN adduser --system -u ${LOCAL_USER_ID:-1000} gazette \
&& apt-get update \
&& apt-get -y install poppler-utils postgresql-client wait-for-it default-jre \
&& apt-get -y install poppler-utils postgresql-client wait-for-it default-jre sqlite3 \
&& pip install --no-cache-dir -r requirements.txt \
&& chmod 755 /tika-app.jar

Expand Down
1 change: 1 addition & 0 deletions processing/data_collection/gazette/database/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ class Gazette(DeclarativeBase):
created_at = Column(DateTime, default=dt.datetime.utcnow)
territory = relationship("Territory", back_populates="gazettes")
territory_id = Column(String, ForeignKey("territories.id"))
processed = Column(Boolean)
__table_args__ = (UniqueConstraint("territory_id", "date", "file_checksum"),)


Expand Down