cronjob อัพเดทสถานะเกษียณอายุราชการ

This commit is contained in:
Bright 2025-01-30 14:40:08 +07:00
parent ca9e79d1a4
commit 21813ffd07
3 changed files with 151 additions and 54 deletions

View file

@ -56,6 +56,16 @@ async function main() {
console.error("Error executing function from controller:", error);
}
});
const cronTime_Oct = "0 0 1 10 *";
cron.schedule(cronTime_Oct, async () => {
try {
const commandController = new CommandController();
await commandController.cronjobUpdateRetirementStatus();
} catch (error) {
console.error("Error executing function from controller:", error);
}
});
// app.listen(APP_PORT, APP_HOST, () => console.log(`Listening on: http://localhost:${APP_PORT}`));
app.listen(