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:
@@ -77,12 +77,7 @@ pub async fn ingest_data(
|
||||
user_id.clone(),
|
||||
)?;
|
||||
|
||||
let futures: Vec<_> = payloads
|
||||
.into_iter()
|
||||
.map(|object| IngestionTask::create_and_add_to_db(object, user_id.clone(), &state.db))
|
||||
.collect();
|
||||
|
||||
try_join_all(futures).await?;
|
||||
IngestionTask::create_all_and_add_to_db(payloads, &user_id, &state.db).await?;
|
||||
|
||||
Ok((StatusCode::OK, Json(json!({ "status": "success" }))))
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user