Skip to content

Commit

Permalink
Add timeout to the cron job to force restart hanging jobs
Browse files Browse the repository at this point in the history
  • Loading branch information
sunu committed Jan 24, 2024
1 parent 8021ee7 commit 788ef1c
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion helm/osmcha/templates/cron.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,14 @@ spec:
- name: osmcha-fetch-changesets
image: {{ .Values.app.api.image.repository }}:{{ .Values.app.api.image.tag }}
imagePullPolicy: IfNotPresent
# Sometimes the fetchchangesets command hangs, so we set a timeout of 10 minutes
# to prevent the job from hanging idly.
# The timeout command kills the process after 10 minutes and forces the job to restart
# with the next scheduled run.
command:
- /bin/sh
- -c
- python manage.py fetchchangesets
- timeout 600s python manage.py fetchchangesets
env:
- name: POSTGRES_HOST
value: {{ .Values.app.api.postgres_host}}
Expand Down

0 comments on commit 788ef1c

Please sign in to comment.