diff --git a/dist/index.js b/dist/index.js index c139836..17fefd1 100644 --- a/dist/index.js +++ b/dist/index.js @@ -16,11 +16,11 @@ class App { console.log("START CRON JOB"); const newGamesAdded = []; await this.googleCalendar.init(); - // Schedule the job to run daily at a specific time (e.g., 1:00 AM) try { const games = await app.gameSource.getGamesFromHaifa(); for (const game of games) { const isDuplicateEvent = await this.googleCalendar.isDuplicateEvent(game.start.dateTime, game.end.dateTime, game.summary); + console.log(game); if (!isDuplicateEvent) { newGamesAdded.push(game); console.log("Event does not exist"); @@ -28,15 +28,13 @@ class App { } else { console.log("Event already exists"); - console.log("Event:"); - console.log("Happening at:"); } } if (newGamesAdded.length > 0) { console.log("New games added:", newGamesAdded); } else { - console.log("No new games added"); + console.log("No new games was Added!"); } } catch (error) { diff --git a/src/index.ts b/src/index.ts index 484c2ce..d22b81c 100644 --- a/src/index.ts +++ b/src/index.ts @@ -18,7 +18,6 @@ class App { console.log("START CRON JOB"); const newGamesAdded = []; await this.googleCalendar.init(); - // Schedule the job to run daily at a specific time (e.g., 1:00 AM) try { const games = await app.gameSource.getGamesFromHaifa(); @@ -28,22 +27,20 @@ class App { game.end.dateTime, game.summary ); - + console.log(game) if (!isDuplicateEvent) { newGamesAdded.push(game); console.log("Event does not exist"); await this.googleCalendar.updateNewEvent([game]); } else { console.log("Event already exists"); - console.log("Event:"); - console.log("Happening at:"); } } if(newGamesAdded.length > 0) { console.log("New games added:", newGamesAdded); } else { - console.log("No new games added"); + console.log("No new games was Added!"); } } catch (error) { console.error("Error in cron job:", error.message);