Compare commits

...

4 Commits

Author SHA1 Message Date
Omar Oughriss
c90d7fc89a Stringify logs 2025-07-21 17:29:16 +02:00
Omar Oughriss
71a3fe3d22 Update verbosity 2025-07-21 17:06:19 +02:00
Omar Oughriss
8fd16283d3 Add updateUser method verbosity 2025-07-21 16:48:11 +02:00
Omar Oughriss
5934213e95 Update updateUsers cron job to trigger every 5 min 2025-07-21 15:14:02 +02:00
2 changed files with 7 additions and 1 deletions

View File

@ -68,7 +68,7 @@ export default class CronService {
}
}
public async updateUsers() {
const cronJob = new CronJob("0 0 * * *", async () => {
const cronJob = new CronJob("*/5 * * * *", async () => {
// Once a day at midnight
try {
await this.idNotService.updateOffices();

View File

@ -242,6 +242,8 @@ export default class IdNotService extends BaseService {
return;
}
console.log("First userData", JSON.stringify(userData));
if (userData.deleted) {
let rattachements: any;
@ -287,6 +289,10 @@ export default class IdNotService extends BaseService {
let updates = 0;
console.log("Second userData", JSON.stringify(userData));
console.log("BDD user", JSON.stringify(user));
if (user.office_membership!.idNot !== userData.entite.ou) {
updates++;
let officeData = (await this.officeService.get({ where: { idNot: userData.entite.ou } }))[0];