Skip to content

Commit 057a409

Browse files
committed
filter out workflow status when listing queue tasks
1 parent 645726b commit 057a409

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

dbos/admin_server.go

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -372,7 +372,10 @@ func newAdminServer(ctx *dbosContext, port int) *adminServer {
372372
}
373373
}
374374

375-
workflows, err := ListWorkflows(ctx, req.toListWorkflowsOptions()...)
375+
req.Status = "" // We are not expecting a filter here but clear just in case
376+
filters := req.toListWorkflowsOptions()
377+
filters = append(filters, WithStatus([]WorkflowStatusType{WorkflowStatusEnqueued, WorkflowStatusPending}))
378+
workflows, err := ListWorkflows(ctx, filters...)
376379
if err != nil {
377380
ctx.logger.Error("Failed to list queued workflows", "error", err)
378381
http.Error(w, fmt.Sprintf("Failed to list queued workflows: %v", err), http.StatusInternalServerError)

0 commit comments

Comments
 (0)