fix OOM Error
All checks were successful
Build & Deploy on Dev / build (push) Successful in 54s

This commit is contained in:
Suphonchai Phoonsawat 2026-05-15 16:37:14 +07:00
parent 9c2caa3f4a
commit 2b000cbd69
5 changed files with 95 additions and 63 deletions

View file

@ -717,9 +717,11 @@ namespace BMA.EHR.Recruit.Controllers
var doc = await _minioService.UploadFileAsync(file);
var import_doc_id = doc.Id.ToString("D");
var fileContent = (await _minioService.DownloadFileAsync(doc.Id)).FileContent;
System.IO.File.WriteAllBytes(importFile, fileContent);
fileContent = null;
// Write file to disk directly from IFormFile instead of downloading back from MinIO
using (var stream = new FileStream(importFile, FileMode.Create))
{
await file.CopyToAsync(stream);
}
// สร้างรอบการบรรจุ
var imported = new RecruitImport
@ -931,9 +933,11 @@ namespace BMA.EHR.Recruit.Controllers
var doc = await _minioService.UploadFileAsync(file);
var import_doc_id = doc.Id.ToString("D");
var fileContent = (await _minioService.DownloadFileAsync(doc.Id)).FileContent;
System.IO.File.WriteAllBytes(importFile, fileContent);
fileContent = null;
// Write file to disk directly from IFormFile instead of downloading back from MinIO
using (var stream = new FileStream(importFile, FileMode.Create))
{
await file.CopyToAsync(stream);
}
// Enqueue background job
var job = _importJobTracker.CreateJob(new ImportJobInfo