Skip to content

Commit

Permalink
add retry, set to run every 30min
Browse files Browse the repository at this point in the history
  • Loading branch information
brankoEISI committed Jan 15, 2024
1 parent 2d5c973 commit 2b11a06
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/app.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import axios from "axios"
import { PutObjectCommand, S3Client } from "@aws-sdk/client-s3"

console.log(`CRON SERVER START`)
cron.schedule("30 2 * * *", async () => {
cron.schedule("*/30 * * * *", async () => {
console.log("========== BEGIN CRON JOB ==========")
if (!process.env.GET_TOKEN_URL || !process.env.SERVICE_ACCOUNT_USERNAME || !process.env.SERVICE_ACCOUNT_PASSWORD
|| !process.env.GET_EVENTS_URL || !process.env.BUCKET || !process.env.BUCKET_KEY_ID || !process.env.BUCKET_KEY
Expand Down Expand Up @@ -74,7 +74,8 @@ const uploadFile = async(file: any) => {
credentials: {
accessKeyId: process.env.BUCKET_KEY_ID as string,
secretAccessKey: process.env.BUCKET_KEY as string,
}
},
retryMode: "standard"
})
const currentDate = getDateString(new Date())
const fileID = `${currentDate}-${process.env.ENVIRONMENT}`
Expand Down

0 comments on commit 2b11a06

Please sign in to comment.