fix cleanup job spilling over 24h

pull/273/head
Frostebite 2021-07-01 22:36:57 +01:00
parent 52e756a174
commit 9fd32a1aa6
3 changed files with 5 additions and 3 deletions

3
dist/index.js vendored
View File

@ -1464,8 +1464,9 @@ class KubernetesCleanupCronJob {
},
],
};
const hours = new Date().getUTCHours() + 3;
batchJob.spec = {
schedule: `0 ${new Date().getUTCHours() + 3} * * *`,
schedule: `0 ${hours > 24 ? hours - 24 : hours} * * *`,
jobTemplate: {
spec: {
template: { spec },

2
dist/index.js.map vendored

File diff suppressed because one or more lines are too long

View File

@ -32,8 +32,9 @@ class KubernetesCleanupCronJob {
},
],
};
const hours = new Date().getUTCHours() + 3;
batchJob.spec = {
schedule: `0 ${new Date().getUTCHours() + 3} * * *`,
schedule: `0 ${hours > 24 ? hours - 24 : hours} * * *`,
jobTemplate: {
spec: {
template: { spec },