docs(bulk-upload): explain chunkSize=10 and 50-file cap constants
Some checks failed
CI / Unit & Component Tests (push) Failing after 3m15s
CI / OCR Service Tests (push) Successful in 47s
CI / Backend Unit Tests (push) Failing after 3m8s
CI / Unit & Component Tests (pull_request) Failing after 3m1s
CI / OCR Service Tests (pull_request) Successful in 38s
CI / Backend Unit Tests (pull_request) Failing after 3m5s
Some checks failed
CI / Unit & Component Tests (push) Failing after 3m15s
CI / OCR Service Tests (push) Successful in 47s
CI / Backend Unit Tests (push) Failing after 3m8s
CI / Unit & Component Tests (pull_request) Failing after 3m1s
CI / OCR Service Tests (pull_request) Successful in 38s
CI / Backend Unit Tests (pull_request) Failing after 3m5s
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -134,6 +134,7 @@ public class DocumentService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void validateBatch(int fileCount, DocumentBatchMetadataDTO metadata) {
|
public void validateBatch(int fileCount, DocumentBatchMetadataDTO metadata) {
|
||||||
|
// 50-file hard cap keeps FormData requests at a manageable size and protects against runaway bulk uploads.
|
||||||
if (fileCount > 50) {
|
if (fileCount > 50) {
|
||||||
throw DomainException.badRequest(ErrorCode.BATCH_TOO_LARGE, "Batch exceeds maximum of 50 files per request");
|
throw DomainException.badRequest(ErrorCode.BATCH_TOO_LARGE, "Batch exceeds maximum of 50 files per request");
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -110,6 +110,7 @@ async function save() {
|
|||||||
if (saving) return;
|
if (saving) return;
|
||||||
saving = true;
|
saving = true;
|
||||||
const entries = Array.from(files.values());
|
const entries = Array.from(files.values());
|
||||||
|
// 10 files per request keeps multipart bodies well under typical reverse-proxy limits (e.g. nginx default 1 MB client_max_body_size per PDF).
|
||||||
const chunkSize = 10;
|
const chunkSize = 10;
|
||||||
const chunks: FileEntry[][] = [];
|
const chunks: FileEntry[][] = [];
|
||||||
for (let i = 0; i < entries.length; i += chunkSize) {
|
for (let i = 0; i < entries.length; i += chunkSize) {
|
||||||
|
|||||||
Reference in New Issue
Block a user