Skip to content

Commit

Permalink
fix(worker): fix mishandled workflow not found
Browse files Browse the repository at this point in the history
  • Loading branch information
heiruwu committed Jul 2, 2024
1 parent 26c76b2 commit 0189dd8
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions pkg/service/worker.go
Original file line number Diff line number Diff line change
Expand Up @@ -65,15 +65,21 @@ func (s *service) GetNamespaceLatestModelOperation(ctx context.Context, ns resou
return nil, err
}

outputWorkflowID := s.redisClient.Get(ctx, fmt.Sprintf("model_trigger_output_key:%s:%s", userUID, dbModel.UID.String())).Val()
outputWorkflowID, err := s.redisClient.Get(ctx, fmt.Sprintf("model_trigger_output_key:%s:%s", userUID, dbModel.UID.String())).Result()
if err != nil {
if errors.Is(err, redis.Nil) {
return nil, nil
}
return nil, err
}

operationID, err := resource.GetOperationID(outputWorkflowID)
if err != nil {
return nil, err
}

workflowExecutionRes, err := s.temporalClient.DescribeWorkflowExecution(ctx, operationID, "")
if err != nil {
fmt.Println(err)
return nil, err
}

Expand Down

0 comments on commit 0189dd8

Please sign in to comment.