cronjob ส่งข้อมูลผู้เกษียณไปให้ระบบพ้นราชการ #2330
All checks were successful
Build & Deploy on Dev / build (push) Successful in 1m17s
All checks were successful
Build & Deploy on Dev / build (push) Successful in 1m17s
This commit is contained in:
parent
e6c3e80a3d
commit
93d4857ea1
4 changed files with 175 additions and 12 deletions
12
src/app.ts
12
src/app.ts
|
|
@ -19,6 +19,7 @@ import { ScriptProfileOrgController } from "./controllers/ScriptProfileOrgContro
|
|||
import { DateSerializer } from "./interfaces/date-serializer";
|
||||
|
||||
import { initWebSocket } from "./services/webSocket";
|
||||
import { RetirementService } from "./services/RetirementService";
|
||||
|
||||
async function main() {
|
||||
await AppDataSource.initialize();
|
||||
|
|
@ -114,6 +115,17 @@ async function main() {
|
|||
}
|
||||
});
|
||||
|
||||
// Cron job for posting retirement data to Exprofile - every day at 04:30:00 on the 1st of October
|
||||
const cronTime_PostRetire = "0 30 4 1 10 *";
|
||||
cron.schedule(cronTime_PostRetire, async () => {
|
||||
try {
|
||||
const retirementService = new RetirementService();
|
||||
await retirementService.cronjobPostRetireToExprofile();
|
||||
} catch (error) {
|
||||
console.error("[Cronjob] Error executing cronjobPostRetireToExprofile:", error);
|
||||
}
|
||||
});
|
||||
|
||||
// app.listen(APP_PORT, APP_HOST, () => console.log(`Listening on: http://localhost:${APP_PORT}`));
|
||||
const server = app.listen(
|
||||
APP_PORT,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue