Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .env.server
Original file line number Diff line number Diff line change
Expand Up @@ -48,3 +48,4 @@ BM25_ACTIVE="true"
FIRECRAWL_URL=https://api.firecrawl.dev
FIRECRAWL_API_KEY=fc-abdef**************
PDF2MD_URL="http://localhost:8081"
BATCH_CHUNK_LIMIT=120
7 changes: 6 additions & 1 deletion server/src/handlers/chunk_handler.rs
Original file line number Diff line number Diff line change
Expand Up @@ -338,7 +338,12 @@ pub async fn create_chunk(
timer.add("get dataset count");
}

if chunks.len() > 120 {
let chunk_limit: usize = std::env::var("BATCH_CHUNK_LIMIT")
.unwrap_or("120".to_string())
.parse()
.unwrap_or(120);

if chunks.len() > chunk_limit {
return Err(ServiceError::PayloadTooLarge(
"Too many chunks provided in bulk. The limit is 120 chunks per bulk upload".to_string(),
)
Expand Down