Compare commits
4 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 1233535b20 | |||
| 2c737b22f1 | |||
| a3bfe9f374 | |||
| a106bb15a8 |
@@ -318,9 +318,9 @@ jobs:
|
|||||||
TAG=${{ github.event.release.tag_name }}
|
TAG=${{ github.event.release.tag_name }}
|
||||||
JOB="job/dalpuri-sync-${TAG}"
|
JOB="job/dalpuri-sync-${TAG}"
|
||||||
|
|
||||||
kubectl wait --for=condition=complete --timeout=1800s -n optima "$JOB" &
|
kubectl wait --for=condition=complete --timeout=7200s -n optima "$JOB" &
|
||||||
WAIT_COMPLETE=$!
|
WAIT_COMPLETE=$!
|
||||||
kubectl wait --for=condition=failed --timeout=1800s -n optima "$JOB" &
|
kubectl wait --for=condition=failed --timeout=7200s -n optima "$JOB" &
|
||||||
WAIT_FAILED=$!
|
WAIT_FAILED=$!
|
||||||
|
|
||||||
wait -n $WAIT_COMPLETE $WAIT_FAILED
|
wait -n $WAIT_COMPLETE $WAIT_FAILED
|
||||||
|
|||||||
@@ -8,7 +8,7 @@ metadata:
|
|||||||
spec:
|
spec:
|
||||||
backoffLimit: 0
|
backoffLimit: 0
|
||||||
ttlSecondsAfterFinished: 86400
|
ttlSecondsAfterFinished: 86400
|
||||||
activeDeadlineSeconds: 1800
|
activeDeadlineSeconds: 7200
|
||||||
template:
|
template:
|
||||||
metadata:
|
metadata:
|
||||||
labels:
|
labels:
|
||||||
@@ -17,10 +17,12 @@ spec:
|
|||||||
containers:
|
containers:
|
||||||
- name: sync
|
- name: sync
|
||||||
image: ghcr.io/horizonstacksoftware/optima-dalpuri-sync:RELEASE_TAG
|
image: ghcr.io/horizonstacksoftware/optima-dalpuri-sync:RELEASE_TAG
|
||||||
envFrom:
|
|
||||||
- secretRef:
|
|
||||||
name: api-env-secret
|
|
||||||
env:
|
env:
|
||||||
|
- name: CW_DATABASE_URL
|
||||||
|
valueFrom:
|
||||||
|
secretKeyRef:
|
||||||
|
name: api-env-secret
|
||||||
|
key: CW_DATABASE_URL
|
||||||
- name: API_DATABASE_URL
|
- name: API_DATABASE_URL
|
||||||
valueFrom:
|
valueFrom:
|
||||||
secretKeyRef:
|
secretKeyRef:
|
||||||
|
|||||||
@@ -294,6 +294,22 @@ const refreshContextFromApi = async (
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const cwMembers = await apiPrisma.cwMember.findMany({
|
||||||
|
select: { cwMemberId: true, identifier: true },
|
||||||
|
});
|
||||||
|
for (const member of cwMembers) {
|
||||||
|
if (
|
||||||
|
member.cwMemberId != null &&
|
||||||
|
member.identifier &&
|
||||||
|
!context.userIdentifiersByMemberRecId.has(member.cwMemberId)
|
||||||
|
) {
|
||||||
|
context.userIdentifiersByMemberRecId.set(
|
||||||
|
member.cwMemberId,
|
||||||
|
member.identifier
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
for (const board of boards) {
|
for (const board of boards) {
|
||||||
context.serviceTicketBoardUidsById.set(board.id, board.uid);
|
context.serviceTicketBoardUidsById.set(board.id, board.uid);
|
||||||
}
|
}
|
||||||
|
|||||||
+24
-4
@@ -323,6 +323,22 @@ const refreshContextFromApi = async (
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const cwMembers = await apiPrisma.cwMember.findMany({
|
||||||
|
select: { cwMemberId: true, identifier: true },
|
||||||
|
});
|
||||||
|
for (const member of cwMembers) {
|
||||||
|
if (
|
||||||
|
member.cwMemberId != null &&
|
||||||
|
member.identifier &&
|
||||||
|
!context.userIdentifiersByMemberRecId.has(member.cwMemberId)
|
||||||
|
) {
|
||||||
|
context.userIdentifiersByMemberRecId.set(
|
||||||
|
member.cwMemberId,
|
||||||
|
member.identifier
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
for (const board of boards) {
|
for (const board of boards) {
|
||||||
context.serviceTicketBoardUidsById.set(board.id, board.uid);
|
context.serviceTicketBoardUidsById.set(board.id, board.uid);
|
||||||
}
|
}
|
||||||
@@ -1860,8 +1876,12 @@ export const executeForcedIncrementalDalpuriSync = async (options?: {
|
|||||||
};
|
};
|
||||||
|
|
||||||
if (import.meta.main) {
|
if (import.meta.main) {
|
||||||
executeFullDalpuriSync().catch((error) => {
|
executeFullDalpuriSync()
|
||||||
console.error("CW -> API sync failed:", error);
|
.then(() => {
|
||||||
process.exit(1);
|
process.exit(0);
|
||||||
});
|
})
|
||||||
|
.catch((error) => {
|
||||||
|
console.error("CW -> API sync failed:", error);
|
||||||
|
process.exit(1);
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user