test snap
This commit is contained in:
parent
ab7544373d
commit
79686e5d45
1 changed files with 76 additions and 72 deletions
|
|
@ -2820,8 +2820,12 @@ export class SalaryPeriodController extends Controller {
|
||||||
console.log("mlength", orgProfileEmployees.length);
|
console.log("mlength", orgProfileEmployees.length);
|
||||||
// const profilesEmpToSave: SalaryProfileEmployee[] = [];
|
// const profilesEmpToSave: SalaryProfileEmployee[] = [];
|
||||||
console.time("⏱ SalaryProfileEmployee - Total Time");
|
console.time("⏱ SalaryProfileEmployee - Total Time");
|
||||||
await Promise.all(
|
// await Promise.all(
|
||||||
orgProfileEmployees.map(async (profile: any) => {
|
// orgProfileEmployees.map(async (profile: any) => {
|
||||||
|
|
||||||
|
const batchSize = 1000;
|
||||||
|
for (let i = 0; i < orgProfileEmployees.length; i += batchSize) {
|
||||||
|
const profile = orgProfileEmployees.slice(i, i + batchSize);
|
||||||
const salaryOrgNew = await this.salaryOrgEmployeeRepository.findOne({
|
const salaryOrgNew = await this.salaryOrgEmployeeRepository.findOne({
|
||||||
where: {
|
where: {
|
||||||
salaryPeriodId: salaryPeriod.id,
|
salaryPeriodId: salaryPeriod.id,
|
||||||
|
|
@ -2893,8 +2897,8 @@ export class SalaryPeriodController extends Controller {
|
||||||
`⚠️ [SNAP: ${snapshot}] ไม่พบ salaryOrgEmployee สำหรับ rootId: ${profile.rootId}`,
|
`⚠️ [SNAP: ${snapshot}] ไม่พบ salaryOrgEmployee สำหรับ rootId: ${profile.rootId}`,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}),
|
}
|
||||||
);
|
// );
|
||||||
console.timeEnd("⏱ SalaryProfileEmployee - Total Time");
|
console.timeEnd("⏱ SalaryProfileEmployee - Total Time");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue