huginn-mind: import::plan owns its foreign keys
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
parent
d215a6fa03
commit
f2cfdcbeb6
1 changed files with 2 additions and 2 deletions
|
|
@ -87,7 +87,7 @@ pub fn plan(campaign: &Slug, source: &Slug, receiver: &Slug, views: Vec<Pipeline
|
||||||
return Err(ImportFault::BatchTooLarge { ordinal, documents: group.len() });
|
return Err(ImportFault::BatchTooLarge { ordinal, documents: group.len() });
|
||||||
}
|
}
|
||||||
let in_batch: BTreeSet<&str> = group.iter().map(|view| view.id.id.0.as_str()).collect();
|
let in_batch: BTreeSet<&str> = group.iter().map(|view| view.id.id.0.as_str()).collect();
|
||||||
let mut foreign: BTreeMap<&str, PipelineRef> = BTreeMap::new();
|
let mut foreign: BTreeMap<String, PipelineRef> = BTreeMap::new();
|
||||||
for view in &group {
|
for view in &group {
|
||||||
for (_, target) in cited(&view.document, receiver) {
|
for (_, target) in cited(&view.document, receiver) {
|
||||||
let key = target.id.0.as_str();
|
let key = target.id.0.as_str();
|
||||||
|
|
@ -97,7 +97,7 @@ pub fn plan(campaign: &Slug, source: &Slug, receiver: &Slug, views: Vec<Pipeline
|
||||||
if root_and_local(key).0 == campaign.0 {
|
if root_and_local(key).0 == campaign.0 {
|
||||||
return Err(ImportFault::Unordered { ordinal, id: Short(key.to_string()) });
|
return Err(ImportFault::Unordered { ordinal, id: Short(key.to_string()) });
|
||||||
}
|
}
|
||||||
foreign.entry(key).or_insert_with(|| target.clone());
|
foreign.entry(key.to_string()).or_insert_with(|| target.clone());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if foreign.len() > IMPORT_EXTERNAL_MAX {
|
if foreign.len() > IMPORT_EXTERNAL_MAX {
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue