From 1f4b038a6ebfc250ddc5ae22c5af78e2b055e88f Mon Sep 17 00:00:00 2001 From: Neil Alexander Date: Wed, 28 Sep 2022 09:59:17 +0100 Subject: [PATCH] And the filter queries --- syncapi/storage/postgres/filter_table.go | 6 ++++++ syncapi/storage/sqlite3/filter_table.go | 6 ++++++ 2 files changed, 12 insertions(+) diff --git a/syncapi/storage/postgres/filter_table.go b/syncapi/storage/postgres/filter_table.go index ecfff414e..6f5ae626d 100644 --- a/syncapi/storage/postgres/filter_table.go +++ b/syncapi/storage/postgres/filter_table.go @@ -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 } diff --git a/syncapi/storage/sqlite3/filter_table.go b/syncapi/storage/sqlite3/filter_table.go index c35124dcf..aa35511ab 100644 --- a/syncapi/storage/sqlite3/filter_table.go +++ b/syncapi/storage/sqlite3/filter_table.go @@ -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 }