Skip to content

Commit e205e7b

Browse files
committed
Crash if sites root node doesn't have an HP3 key
The root node must have an HP3 key, otherwise this HP is not visible to parent instances.
1 parent 0ada4fd commit e205e7b

1 file changed

Lines changed: 10 additions & 1 deletion

File tree

src/sites.rs

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -399,11 +399,20 @@ pub(crate) async fn sites_task(
399399
log::info!("Getting sites info");
400400

401401
let sites = RpcCall::new("sites", "getSites")
402-
.exec(&client_cmd_tx)
402+
.exec::<_, BTreeMap::<_,_>, _>(&client_cmd_tx)
403403
.await;
404404

405405
let (sites_info, sub_hps) = match sites {
406406
Ok(sites) => {
407+
if sites
408+
.get("_meta")
409+
.map(RpcValue::as_map)
410+
.and_then(|map| map.get("type"))
411+
.map(RpcValue::as_str)
412+
.is_some_and(|type_str| type_str == "HP3")
413+
{
414+
panic!("This site's _meta does NOT include an HP3 node. Refusing to continue. Add an HP3 node to the site's _meta, otherwise this HP instance will not be visible to parent HPs.");
415+
}
407416
let sub_hps = collect_sub_hps(&[], &sites);
408417
let mut sites_info = collect_sites(&[], &sites);
409418
for (path, site_info) in &mut sites_info {

0 commit comments

Comments
 (0)