Skip to content

Commit

Permalink
Update pipeline_status.go
Browse files Browse the repository at this point in the history
  • Loading branch information
ftkg committed Oct 23, 2023
1 parent 6c376dd commit fd1bde7
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions server/pipeline_status.go
Original file line number Diff line number Diff line change
Expand Up @@ -124,11 +124,9 @@ func (p *Pipeline) statusFollow(logger *zap.Logger, session Session, envelope *r
for userID := range uniqueUserIDs {
ids = append(ids, userID)
}
counter := 1
if len(ids) != 0 {
query += fmt.Sprintf("id = ANY($%d::UUID[])", counter)
params = append(params, ids)
counter++
query += fmt.Sprintf("id = ANY($%d::UUID[])", len(params))
}

usernames := make([]string, 0, len(uniqueUsernames))
Expand All @@ -138,8 +136,8 @@ func (p *Pipeline) statusFollow(logger *zap.Logger, session Session, envelope *r
if len(uniqueUserIDs) != 0 {
query += " OR "
}
query += fmt.Sprintf("username = ANY($%d::text[])", counter)
params = append(params, usernames)
query += fmt.Sprintf("username = ANY($%d::text[])", len(params))

// See if all the users exist.
rows, err := p.db.QueryContext(session.Context(), query, params...)
Expand Down

0 comments on commit fd1bde7

Please sign in to comment.