no message

This commit is contained in:
Kittapath 2024-07-31 10:57:24 +07:00
parent 603602adbc
commit b9316ab2cc

View file

@ -248,19 +248,19 @@ export class ImportDataController extends Controller {
profileEmp.createdFullName = request.user.name;
profileEmp.lastUpdateUserId = request.user.sub;
profileEmp.lastUpdateFullName = request.user.name;
// profiles.push(profileEmp);
profiles.push(profileEmp);
console.log(">>>>>>>>>>>>>>>>>>>" + rowCount);
// if (profiles.length === BATCH_SIZE) {
await this.profileEmpRepo.save(profileEmp);
// profiles = await [];
// if (global.gc) {
// global.gc();
// }
// }
if (profiles.length === BATCH_SIZE) {
await this.profileEmpRepo.save(profiles);
profiles = await [];
if (global.gc) {
global.gc();
}
}
}
console.log(rowCount);
// await this.profileEmpRepo.save(profiles);
await this.profileEmpRepo.save(profiles);
return new HttpSuccess();
}
@ -338,7 +338,7 @@ export class ImportDataController extends Controller {
profileSalary.lastUpdateFullName = request.user.name;
profileSalarys.push(profileSalary);
// await this.salaryRepository.save(profileSalary);
if (profiles.length === BATCH_SIZE) {
if (profileSalarys.length === BATCH_SIZE) {
await this.salaryRepository.save(profileSalarys);
profileSalarys = await [];
}