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

Run cron jobs in Docker #4387

Merged
merged 6 commits into from
Feb 12, 2021
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.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
19 changes: 19 additions & 0 deletions docker-compose.production.yml
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,25 @@ services:
# Needed by default-docker.conf
- ssl_certificate
- ssl_certificate_key
cron-jobs:
image: oldev:latest
hostname: "$HOSTNAME"
build:
context: .
dockerfile: docker/Dockerfile.oldev
command: cron -f
cclauss marked this conversation as resolved.
Show resolved Hide resolved
restart: always
volumes:
- ../olsystem/etc/cron.d/openlibrary.ol_home0:/etc/cron.d/openlibrary.ol_home0:ro
- ../olsystem:/olsystem
- ol-vendor:/openlibrary/vendor
- .:/openlibrary
- /1/var/tmp:/1/var/tmp
networks:
- webnet
- dbnet
secrets:
- ia_db_pw_file

infobase:
restart: always
Expand Down
2 changes: 1 addition & 1 deletion openlibrary/solr/process_stats.py
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ def process(data):

if doc.get('t_end'):
dt = h.parse_datetime(doc.t_end) - h.parse_datetime(doc.t_start)
hours = dt.days * 24 + dt.seconds / 3600
hours = dt.days * 24 + dt.seconds // 3600
solrdoc['duration_hours_i'] = hours

#last_updated = h.parse_datetime(doc.get('t_end') or doc.get('t_start'))
Expand Down
2 changes: 1 addition & 1 deletion openlibrary/solr/solrwriter.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ def flush(self):
root.append(node)
logger.info("flushing %d documents", len(self.pending_updates))
self.pending_updates = []
xml = tostring(root).encode('utf-8')
xml = tostring(root).decode('utf-8')
self.request(xml)

def commit(self):
Expand Down
File renamed without changes.