Skip to content

Commit

Permalink
Update cronjob for osmcha fetch changesets
Browse files Browse the repository at this point in the history
  • Loading branch information
Rub21 committed Jan 31, 2025
1 parent 7b2b8f0 commit 638f978
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 9 deletions.
15 changes: 6 additions & 9 deletions osm-seed/templates/osmcha-app/cronJob.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ metadata:
environment: {{ .Values.environment }}
release: {{ .Release.Name }}
spec:
schedule: "*/2 * * * *"
schedule: {{ .Values.osmchaApi.fetch_changesets_cronjob }}
concurrencyPolicy: Forbid
successfulJobsHistoryLimit: 1
failedJobsHistoryLimit: 1
Expand Down Expand Up @@ -47,7 +47,7 @@ metadata:
environment: {{ .Values.environment }}
release: {{ .Release.Name }}
spec:
schedule: "0 * * * *"
schedule: {{ .Values.osmchaApi.process_changesets_cronjob }}
concurrencyPolicy: Forbid
successfulJobsHistoryLimit: 1
failedJobsHistoryLimit: 1
Expand All @@ -60,17 +60,14 @@ spec:
- name: {{ .Release.Name }}-osmcha-process-changesets
image: "{{ .Values.osmchaApi.image.name }}:{{ .Values.osmchaApi.image.tag }}"
imagePullPolicy: IfNotPresent
imagePullPolicy: Always
command:
- /bin/sh
- -c
- |
YESTERDAY=$(date -d "yesterday" +%Y-%m-%d)
TODAY=$(date +%Y-%m-%d)
python manage.py backfill_changesets "$YESTERDAY" "$TODAY"
EXIT_CODE=$?
exit $EXIT_CODE
set -x
# Note: This is a hack to make sure for ohm
python manage.py backfill_changesets_id --start_id=100000
envFrom:
- configMapRef:
name: {{ .Release.Name }}-osmcha-common-env
Expand Down
2 changes: 2 additions & 0 deletions osm-seed/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -885,6 +885,8 @@ osmchaApi:
enabled: false
label_key: nodegroup_type
label_value: db
fetch_changesets_cronjob: "*/2 * * * *"
process_changesets_cronjob: "*/2 * * * *"
# ====================================================================================================
# Variables for osmcha DB
# ====================================================================================================
Expand Down

0 comments on commit 638f978

Please sign in to comment.