This commit is contained in:
2025-10-01 10:17:55 +07:00
parent b1f1b2fa96
commit 2e2a70515d

View File

@@ -8,27 +8,39 @@ app.get("/", (req, res) => {
res.json("Scheduler App"); res.json("Scheduler App");
}); });
cron.schedule("0 9 * * *", async () => { cron.schedule(
const module = "Birthday Notification"; "0 9 * * *",
try { async () => {
let res = await axios.get("http://36.66.3.44:7010/birthday-notification"); const module = "Birthday Notification";
console.log(module, "success", res.data); try {
} catch (error) { let res = await axios.get("http://36.66.3.44:7010/birthday-notification");
console.error(module, "error", error.message); console.log(module, "success", res.data);
} catch (error) {
console.error(module, "error", error.message);
}
},
{
timezone: "Asia/Jakarta",
} }
}); );
cron.schedule("0 9 * * *", async () => { cron.schedule(
const module = "Workanniversary"; "1 9 * * *",
try { async () => {
let res = await axios.get( const module = "Workanniversary";
"http://36.66.3.44:7010/workanniversary-notification" try {
); let res = await axios.get(
console.log(module, "success", res.data); "http://36.66.3.44:7010/workanniversary-notification"
} catch (error) { );
console.error(module, "error", error.message); console.log(module, "success", res.data);
} catch (error) {
console.error(module, "error", error.message);
}
},
{
timezone: "Asia/Jakarta",
} }
}); );
app.use((req, res) => { app.use((req, res) => {
res.json("What are you looking for?!"); res.json("What are you looking for?!");