docs: trace_profile UPSERT fixes + Studio face group API gap analysis
- profile.rs: single/group/merge_groups/undo all use upsert_trace_profile - trace_agent_api.rs: hard delete/merge snapshot + delete trace_profiles - cluster_agent.rs, job_worker.rs: background name writes use UPSERT - schema.rs: upsert_trace_profile helper (backfill from tkg_nodes) - Studio 3 API gaps documented (cluster-results/identity-matches/similar)
This commit is contained in:
+14
-17
@@ -2986,7 +2986,6 @@ impl JobWorker {
|
||||
}
|
||||
|
||||
let tkg_table = crate::core::db::schema::table_name("tkg_nodes");
|
||||
let tp_table = crate::core::db::schema::table_name("trace_profiles");
|
||||
|
||||
// Update traces that ARE in clusters
|
||||
for (trace_id, cluster_id) in &trace_to_cluster {
|
||||
@@ -3020,14 +3019,13 @@ impl JobWorker {
|
||||
}
|
||||
|
||||
// Sync name to trace_profiles
|
||||
let _ = sqlx::query(&format!(
|
||||
"UPDATE {} SET name = $1 WHERE file_uuid = $2 AND trace_id = $3",
|
||||
tp_table
|
||||
))
|
||||
.bind(&label)
|
||||
.bind(uuid)
|
||||
.bind(trace_id)
|
||||
.execute(db.pool())
|
||||
let _ = schema::upsert_trace_profile(
|
||||
db.pool(),
|
||||
uuid,
|
||||
*trace_id as i32,
|
||||
&label,
|
||||
None,
|
||||
)
|
||||
.await;
|
||||
}
|
||||
|
||||
@@ -3048,14 +3046,13 @@ impl JobWorker {
|
||||
for tid in &all_trace_ids {
|
||||
if !trace_to_cluster.contains_key(tid) {
|
||||
let name = format!("Person_{}", tid);
|
||||
let _ = sqlx::query(&format!(
|
||||
"UPDATE {} SET name = $1 WHERE file_uuid = $2 AND trace_id = $3",
|
||||
tp_table
|
||||
))
|
||||
.bind(&name)
|
||||
.bind(uuid)
|
||||
.bind(tid)
|
||||
.execute(db.pool())
|
||||
let _ = schema::upsert_trace_profile(
|
||||
db.pool(),
|
||||
uuid,
|
||||
*tid as i32,
|
||||
&name,
|
||||
None,
|
||||
)
|
||||
.await;
|
||||
updated_count += 1;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user