add parent

This commit is contained in:
mamoss 2025-10-07 11:14:00 +07:00
parent 4c16c9859a
commit fd17f366b8
6 changed files with 164 additions and 366 deletions

View file

@ -911,6 +911,7 @@ export class KeycloakController extends Controller {
// keycloak: IsNull(),
isLeave: false,
},
order: { citizenId: "ASC" },
relations: ["roleKeycloaks"],
});
@ -924,12 +925,11 @@ export class KeycloakController extends Controller {
});
// Process แบบ batch เพื่อลดการเรียก API ทีละตัว
const batchSize = 10;
const batchSize = 100;
const batches = [];
for (let i = 0; i < profiles.length; i += batchSize) {
batches.push(profiles.slice(i, i + batchSize));
}
for (const batch of batches) {
await Promise.all(
batch.map(async (_item) => {