Skip to content

Commit

Permalink
Add cluster_uuid filtering to query
Browse files Browse the repository at this point in the history
  • Loading branch information
jhoxhaa committed Nov 29, 2024
1 parent f521904 commit c9d3599
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion pkg/sync/v1/sync.go
Original file line number Diff line number Diff line change
Expand Up @@ -53,9 +53,13 @@ func (s *Sync) Run(ctx context.Context, features ...Feature) error {
func (s *Sync) warmup(ctx context.Context, c *Controller) error {
g, ctx := errgroup.WithContext(ctx)

meta := &schemav1.Meta{ClusterUuid: s.clusterUuid}
query := s.db.BuildSelectStmt(s.factory(), meta) + ` WHERE cluster_uuid=:cluster_uuid`

entities, errs := s.db.YieldAll(ctx, func() (interface{}, error) {
return s.factory(), nil
}, s.db.BuildSelectStmt(s.factory(), &schemav1.Meta{}))
}, query, meta)

// Let errors from YieldAll() cancel the group.
com.ErrgroupReceive(ctx, g, errs)

Expand Down

0 comments on commit c9d3599

Please sign in to comment.