Skip to content

Commit dff268d

Browse files
committed
fix(pegboard): fix collecting metrics for actors without workflows
1 parent 64ab176 commit dff268d

File tree

1 file changed

+15
-1
lines changed
  • packages/edge/services/pegboard/src/ops/actor

1 file changed

+15
-1
lines changed

packages/edge/services/pegboard/src/ops/actor/get.rs

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,21 @@ pub async fn pegboard_actor_get(ctx: &OperationCtx, input: &Input) -> GlobalResu
115115

116116
let actor_data = futures_util::stream::iter(actors_with_wf_ids)
117117
.map(|(actor_id, workflow_id)| async move {
118-
let pool = &ctx.sqlite_for_workflow(workflow_id).await?;
118+
let pool = &match ctx.sqlite_for_workflow(workflow_id).await {
119+
Ok(x) => x,
120+
Err(err)
121+
if matches!(
122+
err.as_workflow_error(),
123+
Some(WorkflowError::WorkflowNotFound)
124+
) =>
125+
{
126+
// Workflow is complete
127+
return GlobalResult::Ok(None);
128+
}
129+
Err(err) => {
130+
return GlobalResult::Err(err);
131+
}
132+
};
119133

120134
let (actor_row, port_ingress_rows, port_host_rows, port_proxied_rows) = tokio::try_join!(
121135
sql_fetch_one!(

0 commit comments

Comments
 (0)