Skip to content
This repository has been archived by the owner on Jan 8, 2024. It is now read-only.

Commit

Permalink
internal/server/boltdbstate: fix dropped errors
Browse files Browse the repository at this point in the history
  • Loading branch information
alrs committed Jul 25, 2023
1 parent 918df22 commit e3a1429
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions internal/server/boltdbstate/pipeline_run.go
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,9 @@ func (s *State) PipelineRunGetByJobId(ctx context.Context, jobId string) (*pb.Pi
var result *pb.PipelineRun
err := s.db.View(func(dbTxn *bolt.Tx) error {
job, err := s.jobById(dbTxn, jobId)
if err != nil {
return err
}
if job.Pipeline == nil {
err = status.Errorf(codes.FailedPrecondition, "no pipeline run associated with job %q", job)
return err
Expand All @@ -117,6 +120,9 @@ func (s *State) PipelineRunGetByJobId(ctx context.Context, jobId string) (*pb.Pi
},
}
p, err := s.pipelineGet(dbTxn, memTxn, ref)
if err != nil {
return err
}
result, err = s.pipelineRunGet(dbTxn, memTxn, p.Id, job.Pipeline.RunSequence)
return err
})
Expand All @@ -135,6 +141,9 @@ func (s *State) PipelineRunGet(ctx context.Context, ref *pb.Ref_Pipeline, seq ui
var result *pb.PipelineRun
err := s.db.View(func(dbTxn *bolt.Tx) error {
p, err := s.pipelineGet(dbTxn, memTxn, ref)
if err != nil {
return err
}
result, err = s.pipelineRunGet(dbTxn, memTxn, p.Id, seq)
return err
})
Expand Down

0 comments on commit e3a1429

Please sign in to comment.