From ca5d3cc3e0cebe783a6c5434dbf4b657e1faa85d Mon Sep 17 00:00:00 2001 From: teddys48 Date: Fri, 13 Feb 2026 10:08:35 +0700 Subject: [PATCH] update --- docker-compose.yaml | 6 ++++++ index.js | 38 ++++++++++++++++++++------------------ 2 files changed, 26 insertions(+), 18 deletions(-) diff --git a/docker-compose.yaml b/docker-compose.yaml index cfe40c9..638a94e 100644 --- a/docker-compose.yaml +++ b/docker-compose.yaml @@ -10,3 +10,9 @@ services: mem_limit: 50m cpus: 0.01 + networks: + - scheduler-net + +networks: + scheduler-net: + external: true diff --git a/index.js b/index.js index c92fe6b..5228c12 100644 --- a/index.js +++ b/index.js @@ -13,25 +13,9 @@ cron.schedule( "0 9 * * *", async () => { const module = "Birthday Notification"; - try { - let res = await axios.get("http://36.66.3.44:7010/birthday-notification"); - console.log(module, "success", res.data); - } catch (error) { - console.error(module, "error", error.message); - } - }, - { - timezone: "Asia/Jakarta", - } -); - -cron.schedule( - "1 9 * * *", - async () => { - const module = "Workanniversary"; try { let res = await axios.get( - "http://36.66.3.44:7010/workanniversary-notification" + "http://email-notification:9997/birthday-notification", ); console.log(module, "success", res.data); } catch (error) { @@ -40,7 +24,25 @@ cron.schedule( }, { timezone: "Asia/Jakarta", - } + }, +); + +cron.schedule( + "1 9 * * *", + async () => { + const module = "Workanniversary"; + try { + let res = await axios.get( + "http://email-notification:9997/workanniversary-notification", + ); + console.log(module, "success", res.data); + } catch (error) { + console.error(module, "error", error.message); + } + }, + { + timezone: "Asia/Jakarta", + }, ); app.use((req, res) => {