Skip to content

Commit

Permalink
Add ORM method FindJobIDByStreamID and cover approving stream specs w…
Browse files Browse the repository at this point in the history
…ith a test.
  • Loading branch information
ro-tex committed Nov 26, 2024
1 parent bc8e921 commit fd08f2a
Show file tree
Hide file tree
Showing 5 changed files with 624 additions and 4 deletions.
5 changes: 5 additions & 0 deletions .changeset/thin-cats-try.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"chainlink": minor
---

Add support for Mercury LLO streams to feeds service.
6 changes: 2 additions & 4 deletions core/services/feeds/service.go
Original file line number Diff line number Diff line change
Expand Up @@ -862,14 +862,12 @@ func (s *service) ApproveSpec(ctx context.Context, id int64, force bool) error {
return fmt.Errorf("failed while checking for existing ccip job: %w", txerr)
}
case job.Stream:
var existingJob job.Job
existingJob, txerr = tx.jobORM.FindJobByExternalJobID(ctx, j.ExternalJobID)
existingJobID, txerr = tx.jobORM.FindJobIDByStreamID(ctx, *j.StreamID)
// Return an error if the repository errors. If there is a not found
// error we want to continue with approving the job.
if txerr != nil && !errors.Is(txerr, sql.ErrNoRows) {
return fmt.Errorf("failed while checking for existing ccip job: %w", txerr)
return fmt.Errorf("failed while checking for existing stream job: %w", txerr)
}
existingJobID = existingJob.ID
default:
return errors.Errorf("unsupported job type when approving job proposal specs: %s", j.Type)
}
Expand Down
Loading

0 comments on commit fd08f2a

Please sign in to comment.