summaryrefslogtreecommitdiff
path: root/internal/db/bundb/marker.go
diff options
context:
space:
mode:
authorLibravatar kim <89579420+NyaaaWhatsUpDoc@users.noreply.github.com>2023-08-31 10:46:15 +0100
committerLibravatar GitHub <noreply@github.com>2023-08-31 11:46:15 +0200
commit1ee99fc16583e4cefc46011dbc63ca8ed91d3189 (patch)
tree950b661bb7c7b4cdb5057ee824ba75ae15fd3adc /internal/db/bundb/marker.go
parent[chore]: Bump github.com/google/uuid from 1.3.0 to 1.3.1 (#2166) (diff)
downloadgotosocial-1ee99fc16583e4cefc46011dbc63ca8ed91d3189.tar.xz
[bugfix] wrap bun.Tx to add our own error processing (#2169)
* wrap bun.Tx to add our own error processing Signed-off-by: kim <grufwub@gmail.com> * add compile-time check for updateRowError() compatibility with sql.Row, fix wrapTx() not being used properly Signed-off-by: kim <grufwub@gmail.com> --------- Signed-off-by: kim <grufwub@gmail.com>
Diffstat (limited to 'internal/db/bundb/marker.go')
-rw-r--r--internal/db/bundb/marker.go2
1 files changed, 1 insertions, 1 deletions
diff --git a/internal/db/bundb/marker.go b/internal/db/bundb/marker.go
index 861f7de36..5d365e08a 100644
--- a/internal/db/bundb/marker.go
+++ b/internal/db/bundb/marker.go
@@ -87,7 +87,7 @@ func (m *markerDB) UpdateMarker(ctx context.Context, marker *gtsmodel.Marker) er
// Optimistic concurrency control: start a transaction, try to update a row with a previously retrieved version.
// If the update in the transaction fails to actually change anything, another update happened concurrently, and
// this update should be retried by the caller, which in this case involves sending HTTP 409 to the API client.
- return m.db.RunInTx(ctx, func(tx bun.Tx) error {
+ return m.db.RunInTx(ctx, func(tx Tx) error {
result, err := tx.NewUpdate().
Model(marker).
WherePK().