diff --git a/.dockerignore b/.dockerignore index 5171c54..92a116f 100644 --- a/.dockerignore +++ b/.dockerignore @@ -1,2 +1,4 @@ node_modules -npm-debug.log \ No newline at end of file +npm-debug.log +src +tmp \ No newline at end of file diff --git a/Dockerfile b/Dockerfile index 8d2ae21..7d0eb91 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -FROM node:latest +FROM node:16 # Create app directory WORKDIR /usr/src/app diff --git a/src/index.ts b/src/index.ts index 39ee401..b9f4ca3 100644 --- a/src/index.ts +++ b/src/index.ts @@ -40,17 +40,18 @@ class App { const app = new App(); console.log("Declaring Cron Job every day at 10:00") -const cron = "0 10 * * *" // every day at 10:00 - const job = new CronJob( - "* * * * *", + "0 10 * * *", // every day at 10:00, async () => { - console.log("START") + console.log("Staring a new job") const outputFileLocation = 'public/maccabi-haifa-fc.ics'; + console.log("Getting games from Haifa") const games = await app.gameSource.getGamesFromHaifa(); + console.log("Generating ICS file") const icsEvents = app.ics.generateIcsOutputFromGames(games); + console.log("Writing ICS file to " + outputFileLocation) fs.writeFileSync(outputFileLocation, icsEvents); - console.log("END") + console.log("Done") }, null, true,