mirror of
https://github.com/perstarkse/minne.git
synced 2026-05-30 03:10:45 +02:00
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:
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user