cronjob อัพเดทสถานะเกษียณอายุราชการ
This commit is contained in:
parent
ca9e79d1a4
commit
21813ffd07
3 changed files with 151 additions and 54 deletions
10
src/app.ts
10
src/app.ts
|
|
@ -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(
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue