mirror of
https://github.com/fabro-sh/fabro.git
synced 2026-10-10 03:30:59 +00:00
fix(workflow): keep event replay alive on unknown stage status
Fall back to StageStatus::Fail with a warning when historical event data contains an unrecognized stage status string instead of panicking during replay.
This commit is contained in:
parent
1176bf6d60
commit
413112249c
1 changed files with 8 additions and 1 deletions
|
|
@ -1348,7 +1348,14 @@ fn billed_token_counts_from_llm(usage: &LlmTokenCounts) -> BilledTokenCounts {
|
|||
}
|
||||
|
||||
fn stage_status_from_string(status: &str) -> StageStatus {
|
||||
serde_json::from_value(Value::String(status.to_string())).expect("valid stage status")
|
||||
status.parse().unwrap_or_else(|_| {
|
||||
tracing::warn!(
|
||||
status,
|
||||
"unknown stored stage status in StageCompleted event; \
|
||||
falling back to StageStatus::Fail to keep replay alive"
|
||||
);
|
||||
StageStatus::Fail
|
||||
})
|
||||
}
|
||||
|
||||
fn stored_event_fields(event: &Event, scope: Option<&StageScope>) -> StoredEventFields {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue