Revert "Merge branch 'feat/keyloak-token-data' into develop"
All checks were successful
Build & Deploy on Dev / build (push) Successful in 2m21s

This reverts commit 1b3806c6f7, reversing
changes made to 79dbba2c89.
This commit is contained in:
Warunee Tamkoo 2026-02-26 22:37:03 +07:00
parent 30fd08fc85
commit 1c629cc6e0
13 changed files with 33 additions and 2582 deletions

View file

@ -15,7 +15,6 @@ import { logMemoryStore } from "./utils/LogMemoryStore";
import { orgStructureCache } from "./utils/OrgStructureCache";
import { CommandController } from "./controllers/CommandController";
import { ProfileSalaryController } from "./controllers/ProfileSalaryController";
import { ScriptProfileOrgController } from "./controllers/ScriptProfileOrgController";
import { DateSerializer } from "./interfaces/date-serializer";
import { initWebSocket } from "./services/webSocket";
@ -53,19 +52,8 @@ async function main() {
const APP_HOST = process.env.APP_HOST || "0.0.0.0";
const APP_PORT = +(process.env.APP_PORT || 3000);
// Cron job for executing command - every day at 00:30:00
const cronTime_command = "0 30 0 * * *";
cron.schedule(cronTime_command, async () => {
try {
const commandController = new CommandController();
await commandController.cronjobCommand();
} catch (error) {
console.error("Error executing function from controller:", error);
}
});
// Cron job for updating org revision - every day at 01:00:00
const cronTime = "0 0 1 * * *";
const cronTime = "0 0 3 * * *"; // ตั้งเวลาทุกวันเวลา 03:00:00
// const cronTime = "*/10 * * * * *";
cron.schedule(cronTime, async () => {
try {
const orgController = new OrganizationController();
@ -75,8 +63,18 @@ async function main() {
}
});
// Cron job for updating retirement status - every day at 02:00:00 on the 1st of October
const cronTime_Oct = "0 0 2 10 *";
const cronTime_command = "0 0 2 * * *";
// const cronTime_command = "*/10 * * * * *";
cron.schedule(cronTime_command, async () => {
try {
const commandController = new CommandController();
await commandController.cronjobCommand();
} catch (error) {
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();
@ -86,19 +84,7 @@ async function main() {
}
});
// Cron job for updating org DNA - every day at 03:00:00
const cronTime_UpdateOrg = "0 0 3 * * *";
cron.schedule(cronTime_UpdateOrg, async () => {
try {
const scriptProfileOrgController = new ScriptProfileOrgController();
await scriptProfileOrgController.cronjobUpdateOrg({} as any);
} catch (error) {
console.error("Error executing cronjobUpdateOrg:", error);
}
});
// Cron job for updating tenure - every day at 04:00:00
const cronTime_Tenure = "0 0 4 * * *";
const cronTime_Tenure = "0 0 0 * * *";
cron.schedule(cronTime_Tenure, async () => {
try {
const profileSalaryController = new ProfileSalaryController();