huskies: merge 1062

This commit is contained in:
dave
2026-05-14 20:29:12 +00:00
parent 5678f2a556
commit 8f666bd6b3
2 changed files with 51 additions and 10 deletions
+7 -10
View File
@@ -346,8 +346,6 @@ pub(crate) fn spawn_event_trigger_subscriber(
continue;
}
let mut to_cancel: Vec<String> = Vec::new();
for trigger in &triggers {
if !trigger.predicate.matches(&fired) {
continue;
@@ -361,6 +359,13 @@ pub(crate) fn spawn_event_trigger_subscriber(
crate::pipeline_state::stage_label(&fired.after),
);
// Cancel once-mode triggers before dispatching the action so
// that a server restart triggered by the action (e.g.
// rebuild_and_restart) cannot find and replay the trigger.
if trigger.mode == FireMode::Once {
store.cancel(&trigger.id);
}
match &trigger.action {
TriggerAction::Mcp { method, args } => {
execute_mcp_action(method, args.clone(), &ctx).await;
@@ -375,14 +380,6 @@ pub(crate) fn spawn_event_trigger_subscriber(
.await;
}
}
if trigger.mode == FireMode::Once {
to_cancel.push(trigger.id.clone());
}
}
if !to_cancel.is_empty() {
store.cancel_batch(&to_cancel);
}
}
});