diff options
author | Neil Alexander <neilalexander@users.noreply.github.com> | 2022-09-20 15:01:19 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-09-20 15:01:19 +0100 |
commit | bd39748b5c8b1890950db100382d3b128d333222 (patch) | |
tree | 7236946f5c7cd87f5a01c68f6f9a45df4b731b92 /internal | |
parent | 201ac0594336046679cf3612405e85e802a57e12 (diff) |
Update dependencies (#2729)
This updates Dendrite dependencies.
Diffstat (limited to 'internal')
-rw-r--r-- | internal/sqlutil/unique_constraint.go | 2 | ||||
-rw-r--r-- | internal/sqlutil/writer_exclusive.go | 2 |
2 files changed, 1 insertions, 3 deletions
diff --git a/internal/sqlutil/unique_constraint.go b/internal/sqlutil/unique_constraint.go index 4a1b7fd9..ed70f5ed 100644 --- a/internal/sqlutil/unique_constraint.go +++ b/internal/sqlutil/unique_constraint.go @@ -27,8 +27,6 @@ func IsUniqueConstraintViolationErr(err error) bool { switch e := err.(type) { case *pq.Error: return e.Code == "23505" - case pq.Error: - return e.Code == "23505" case *sqlite3.Error: return e.Code == sqlite3.ErrConstraint case sqlite3.Error: diff --git a/internal/sqlutil/writer_exclusive.go b/internal/sqlutil/writer_exclusive.go index 91dd77e4..8eff3ce5 100644 --- a/internal/sqlutil/writer_exclusive.go +++ b/internal/sqlutil/writer_exclusive.go @@ -57,7 +57,7 @@ func (w *ExclusiveWriter) Do(db *sql.DB, txn *sql.Tx, f func(txn *sql.Tx) error) // opened using the database object from the task and then this will // be passed as a parameter to the task function. func (w *ExclusiveWriter) run() { - if !w.running.CAS(false, true) { + if !w.running.CompareAndSwap(false, true) { return } if tracingEnabled { |