Skip to content

Commit 063ac2a

Browse files
committed
fix(agent): fix updating agent when some instances are live and some aren't
1 parent e1c2a96 commit 063ac2a

File tree

2 files changed

+10
-5
lines changed

2 files changed

+10
-5
lines changed

src/action/mod.rs

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -131,10 +131,7 @@ pub struct WithTargetUnitTrace {
131131

132132
impl WithTargetUnitTrace {
133133
fn add_unit_id(&mut self, target: &str, unit_id: &str) {
134-
let unit_ids = self
135-
.unit_ids_applied_by_key
136-
.entry(target.to_string())
137-
.or_insert_with(LinkedHashSet::new);
134+
let unit_ids = self.unit_ids_applied_by_key.entry(target.to_string()).or_default();
138135
unit_ids.insert(unit_id.to_string());
139136
}
140137

src/api/impact.rs

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -241,7 +241,15 @@ impl ImpactOutput {
241241
'outer: for i in 1..=max_hops {
242242
let new_example = example.with_url(current_url.clone()).with_method(Some(current_method.clone()));
243243

244-
let request = Request::from_example(&router.config, &new_example).unwrap();
244+
let request = match Request::from_example(&router.config, &new_example) {
245+
Ok(request) => request,
246+
Err(err) => {
247+
log::warn!("cannot create request from new target: {:?} : {}", new_example, err);
248+
249+
break;
250+
}
251+
};
252+
245253
let routes = router.match_request(&request);
246254
let mut action = Action::from_routes_rule(routes, &request, None);
247255

0 commit comments

Comments
 (0)