Add logging for price checking and execute scheduled task immediately

This commit is contained in:
Norbert Maciaszek
2025-11-15 20:13:38 +01:00
parent b62389085f
commit 1559e4ccc9

View File

@@ -82,6 +82,7 @@ async function init() {
const productsPrice = []; const productsPrice = [];
const selectors = Object.keys(priceSelectors); const selectors = Object.keys(priceSelectors);
console.log("Zaczynam sprawdzać ceny");
for (const product of productsWithLinks) { for (const product of productsWithLinks) {
if (product.link === "") continue; if (product.link === "") continue;
@@ -142,6 +143,8 @@ async function init() {
} }
sendMessage("Zaczynam monitoring cen"); sendMessage("Zaczynam monitoring cen");
cron.schedule("* */3 * * *", async () => { const task = cron.schedule("* */3 * * *", async () => {
await init(); await init();
}); });
task.execute();