chore: optimize ingest payloads and add parallel task batch store

Parse content before building file payloads to move shared metadata when
possible, add create_all_and_add_to_db for concurrent stores, and extend
tests for batch persistence and payload edge cases.
This commit is contained in:
Per Stark
2026-05-28 21:01:36 +02:00
parent 85336d77a3
commit 97beb91710
4 changed files with 303 additions and 67 deletions
+2 -6
View File
@@ -146,12 +146,8 @@ pub async fn process_ingest_form(
user.id.clone(),
)?;
let futures: Vec<_> = payloads
.into_iter()
.map(|object| IngestionTask::create_and_add_to_db(object, user.id.clone(), &state.db))
.collect();
let tasks = try_join_all(futures).await?;
let tasks =
IngestionTask::create_all_and_add_to_db(payloads, &user.id, &state.db).await?;
#[derive(Serialize)]
struct NewTasksData {