update
This commit is contained in:
@@ -10,3 +10,9 @@ services:
|
|||||||
|
|
||||||
mem_limit: 50m
|
mem_limit: 50m
|
||||||
cpus: 0.01
|
cpus: 0.01
|
||||||
|
networks:
|
||||||
|
- scheduler-net
|
||||||
|
|
||||||
|
networks:
|
||||||
|
scheduler-net:
|
||||||
|
external: true
|
||||||
|
|||||||
36
index.js
36
index.js
@@ -13,25 +13,9 @@ cron.schedule(
|
|||||||
"0 9 * * *",
|
"0 9 * * *",
|
||||||
async () => {
|
async () => {
|
||||||
const module = "Birthday Notification";
|
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 {
|
try {
|
||||||
let res = await axios.get(
|
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);
|
console.log(module, "success", res.data);
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
@@ -40,7 +24,25 @@ cron.schedule(
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
timezone: "Asia/Jakarta",
|
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) => {
|
app.use((req, res) => {
|
||||||
|
|||||||
Reference in New Issue
Block a user