Merge pull request #696 from LibreQoE/issue_695_child_parent_vary

FIXES #695 - all circuits will share the same parent node on import.
This commit is contained in:
Robert Chacón authored and GitHub committed 2025-04-17 17:17:19 -06:00
commit 7f54c13eff
1 file changed
+8 -1
@@ -309,6 +309,7 @@ pub async fn build_full_network_v2(
// Shaped Devices
let mut shaped_devices = Vec::new();
let mut circuit_parents: HashMap<String, String> = HashMap::new();
for (ap_id, client_sites) in client_mappings.iter() {
for site_id in client_sites.iter() {
@@ -339,7 +340,7 @@ pub async fn build_full_network_v2(
let download_max = u64::max(4, download_max);
let upload_max = u64::max(4, upload_max);
let parent_node = {
let mut parent_node = {
if parents.get(&ap_device.name).is_some() {
ap_device.name.clone()
} else {
@@ -347,6 +348,12 @@ pub async fn build_full_network_v2(
}
};
if let Some(previous) = circuit_parents.get(&site.name) {
parent_node = previous.clone();
} else {
circuit_parents.insert(site.name.clone(), parent_node.clone());
}
let shaped_device = ShapedDevice {
circuit_id: site.id.to_owned(),
circuit_name: site.name.to_owned(),