From f4cf64e1647a093615fc8e2def46982a1b57ef95 Mon Sep 17 00:00:00 2001 From: vhaudiquet Date: Fri, 13 Dec 2024 18:59:35 +0100 Subject: [PATCH] Added logs to patch_collector --- patch_detector/index.ts | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/patch_detector/index.ts b/patch_detector/index.ts index a970a0b..bd2313f 100644 --- a/patch_detector/index.ts +++ b/patch_detector/index.ts @@ -3,8 +3,11 @@ import { MongoClient } from "mongodb"; main() async function main() { - const client = await connectToDatabase(); - const newPatch = await fetchLatestPatch(); + const client = await connectToDatabase() + const newPatch = await fetchLatestPatch() + + console.log("Latest patch is: " + newPatch) + const newDate = new Date() if(!(await compareLatestSavedPatch(client, newPatch, newDate))) { downloadAssets() @@ -34,6 +37,8 @@ async function compareLatestSavedPatch(client: MongoClient, newPatch : string, n const patches = database.collection("patches") const latestPatch = await patches.find().limit(1).sort({date:-1}).next() + console.log("Latest patch in database is: " + latestPatch) + if(latestPatch.patch != newPatch) { await patches.insertOne({patch:newPatch, date:newDate}) return false