And the filter queries

This commit is contained in:
Neil Alexander 2022-09-28 09:59:17 +01:00
parent 4738a192b6
commit 1f4b038a6e
No known key found for this signature in database
GPG key ID: A02A2019A2BB0944
2 changed files with 12 additions and 0 deletions

View file

@ -112,8 +112,14 @@ func (s *filterStatements) InsertFilter(
// This can result in a race condition when two clients try to insert the
// same filter and localpart at the same time, however this is not a
// problem as both calls will result in the same filterID
<<<<<<< Updated upstream
err = sqlutil.TxStmt(txn, s.selectFilterIDByContentStmt).QueryRowContext(ctx,
localpart, filterJSON).Scan(&existingFilterID)
=======
err = sqlutil.TxStmt(txn, s.selectFilterIDByContentStmt).QueryRowContext(
ctx, localpart, filterJSON,
).Scan(&existingFilterID)
>>>>>>> Stashed changes
if err != nil && err != sql.ErrNoRows {
return "", err
}

View file

@ -116,8 +116,14 @@ func (s *filterStatements) InsertFilter(
// This can result in a race condition when two clients try to insert the
// same filter and localpart at the same time, however this is not a
// problem as both calls will result in the same filterID
<<<<<<< Updated upstream
err = sqlutil.TxStmt(txn, s.selectFilterIDByContentStmt).QueryRowContext(ctx,
localpart, filterJSON).Scan(&existingFilterID)
=======
err = sqlutil.TxStmt(txn, s.selectFilterIDByContentStmt).QueryRowContext(
ctx, localpart, filterJSON,
).Scan(&existingFilterID)
>>>>>>> Stashed changes
if err != nil && err != sql.ErrNoRows {
return "", err
}