Skip to content

Commit 4088eaf

Browse files
authored
Merge pull request #450 from bcgov/bugfix/peach-cronjob
fix(peach-sync): removed npm dependency and fixed in proper indenting in PEACH cronjob yaml
2 parents 04012de + d548c70 commit 4088eaf

4 files changed

Lines changed: 15 additions & 15 deletions

File tree

app/src/controllers/peach.ts

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -115,22 +115,22 @@ export const syncPeachRecords = async (): Promise<Permit[]> => {
115115
);
116116

117117
const records: PeachRecord[] = [];
118-
const failures: { index: number; reason: unknown }[] = [];
118+
const errors: { index: number; reason: unknown }[] = [];
119119
results.forEach((result, index) => {
120120
if (result.status === 'fulfilled') records.push(result.value);
121-
else failures.push({ index: index, reason: result.reason });
121+
else errors.push({ index: index, reason: result.reason });
122122
});
123123

124124
log.verbose('PEACH fetch summary', {
125125
total: results.length,
126126
fetched: records.length,
127-
failed: failures.length
127+
errored: errors.length
128128
});
129129

130-
if (failures.length) {
131-
for (const failure of failures) {
132-
const { recordId, systemId } = systemRecordPermits[failure.index];
133-
log.warn('PEACH fetch failed', { recordId, systemId, error: failure.reason });
130+
if (errors.length) {
131+
for (const error of errors) {
132+
const { recordId, systemId } = systemRecordPermits[error.index];
133+
log.warn('PEACH fetch call error:', { recordId, systemId, error: error.reason });
134134
}
135135
}
136136

charts/pcns/Chart.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ name: nr-permitconnect-navigator-service
33
# This is the chart version. This version number should be incremented each time you make changes
44
# to the chart and its templates, including the app version.
55
# Versions are expected to follow Semantic Versioning (https://semver.org/)
6-
version: 0.0.31
6+
version: 0.0.32
77
kubeVersion: ">= 1.13.0"
88
description: PermitConnect Navigator Service
99
# A chart can be either an 'application' or a 'library' chart.

charts/pcns/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# nr-permitconnect-navigator-service
22

3-
![Version: 0.0.31](https://img.shields.io/badge/Version-0.0.31-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: 0.9.0](https://img.shields.io/badge/AppVersion-0.9.0-informational?style=flat-square)
3+
![Version: 0.0.32](https://img.shields.io/badge/Version-0.0.32-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: 0.9.0](https://img.shields.io/badge/AppVersion-0.9.0-informational?style=flat-square)
44

55
PermitConnect Navigator Service
66

charts/pcns/templates/peachsynccronjob.yaml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -42,9 +42,9 @@ spec:
4242
- name: peach-sync
4343
image: "{{ .Values.image.repository }}/{{ .Chart.Name }}:{{ .Values.image.tag | default .Chart.AppVersion }}"
4444
imagePullPolicy: {{ .Values.image.pullPolicy }}
45-
command: ["sh","-lc"]
46-
args:
47-
- "npm run peach:sync"
45+
command:
46+
- /usr/local/bin/node
47+
- sbin/peachSync.js
4848
resources:
4949
{{- toYaml .Values.peachSync.resources | nindent 16 }}
5050
env:
@@ -81,9 +81,9 @@ spec:
8181
name: {{ include "pcns.configname" . }}-ches-service-account
8282
- name: SERVER_PEACH_CLIENTID
8383
valueFrom:
84-
secretKeyRef:
85-
key: username
86-
name: {{ include "pcns.configname" . }}-peach
84+
secretKeyRef:
85+
key: username
86+
name: {{ include "pcns.configname" . }}-peach
8787
- name: SERVER_PEACH_CLIENTSECRET
8888
valueFrom:
8989
secretKeyRef:

0 commit comments

Comments
 (0)