Revert "fix: sync and script keycloak"
All checks were successful
Build & Deploy on Dev / build (push) Successful in 2m11s
All checks were successful
Build & Deploy on Dev / build (push) Successful in 2m11s
This reverts commit d667ad9173.
This commit is contained in:
parent
d667ad9173
commit
c5c19b6d5e
12 changed files with 33 additions and 2444 deletions
44
src/app.ts
44
src/app.ts
|
|
@ -18,7 +18,6 @@ import { ProfileSalaryController } from "./controllers/ProfileSalaryController";
|
|||
import { DateSerializer } from "./interfaces/date-serializer";
|
||||
|
||||
import { initWebSocket } from "./services/webSocket";
|
||||
import { ScriptProfileOrgController } from "./controllers/ScriptProfileOrgController";
|
||||
|
||||
async function main() {
|
||||
await AppDataSource.initialize();
|
||||
|
|
@ -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();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue