Skip to content

Commit

Permalink
Fix missing run status in event details (#1212)
Browse files Browse the repository at this point in the history
  • Loading branch information
goodoldneon committed Mar 5, 2024
1 parent 6945e02 commit 05b44ce
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions pkg/coreapi/graph/models/converters.go
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
package models

import (
"context"
"fmt"

"github.com/inngest/inngest/pkg/cqrs"
"github.com/inngest/inngest/pkg/enums"
"github.com/inngest/inngest/pkg/logger"
)

func MakeFunction(f *cqrs.Function) (*Function, error) {
Expand Down Expand Up @@ -51,6 +53,16 @@ func MakeFunction(f *cqrs.Function) (*Function, error) {
}

func MakeFunctionRun(f *cqrs.FunctionRun) *FunctionRun {
status, err := ToFunctionRunStatus(f.Status)
if err != nil {
logger.StdlibLogger(context.Background()).
Error(
"unknown run status",
"error", err,
"status", f.Status.String(),
)
}

// TODO: Map GQL types to CQRS types and remove this.
r := &FunctionRun{
ID: f.RunID.String(),
Expand All @@ -59,6 +71,7 @@ func MakeFunctionRun(f *cqrs.FunctionRun) *FunctionRun {
StartedAt: &f.RunStartedAt,
EventID: f.EventID.String(),
BatchID: f.BatchID,
Status: &status,
}
if len(f.Output) > 0 {
str := string(f.Output)
Expand Down

0 comments on commit 05b44ce

Please sign in to comment.