Compare commits
4 Commits
6c30016e0d
...
c90d7fc89a
Author | SHA1 | Date | |
---|---|---|---|
![]() |
c90d7fc89a | ||
![]() |
71a3fe3d22 | ||
![]() |
8fd16283d3 | ||
![]() |
5934213e95 |
@ -68,7 +68,7 @@ export default class CronService {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
public async updateUsers() {
|
public async updateUsers() {
|
||||||
const cronJob = new CronJob("0 0 * * *", async () => {
|
const cronJob = new CronJob("*/5 * * * *", async () => {
|
||||||
// Once a day at midnight
|
// Once a day at midnight
|
||||||
try {
|
try {
|
||||||
await this.idNotService.updateOffices();
|
await this.idNotService.updateOffices();
|
||||||
|
@ -242,6 +242,8 @@ export default class IdNotService extends BaseService {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
console.log("First userData", JSON.stringify(userData));
|
||||||
|
|
||||||
if (userData.deleted) {
|
if (userData.deleted) {
|
||||||
let rattachements: any;
|
let rattachements: any;
|
||||||
|
|
||||||
@ -287,6 +289,10 @@ export default class IdNotService extends BaseService {
|
|||||||
|
|
||||||
let updates = 0;
|
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) {
|
if (user.office_membership!.idNot !== userData.entite.ou) {
|
||||||
updates++;
|
updates++;
|
||||||
let officeData = (await this.officeService.get({ where: { idNot: userData.entite.ou } }))[0];
|
let officeData = (await this.officeService.get({ where: { idNot: userData.entite.ou } }))[0];
|
||||||
|
Loading…
x
Reference in New Issue
Block a user