summaryrefslogtreecommitdiff
path: root/internal/db/bundb/marker.go
diff options
context:
space:
mode:
authorLibravatar kim <89579420+NyaaaWhatsUpDoc@users.noreply.github.com>2024-02-07 14:43:27 +0000
committerLibravatar GitHub <noreply@github.com>2024-02-07 14:43:27 +0000
commit6738fd5bb0193daf3e2b524105ff690e8bfc32f4 (patch)
tree1c9b84846e21c737746f2a528170ad1d4bfb0a1c /internal/db/bundb/marker.go
parent[bugfix] Ensure activities sender always = activities actor (#2608) (diff)
downloadgotosocial-6738fd5bb0193daf3e2b524105ff690e8bfc32f4.tar.xz
[feature/performance] sqlite pragma optimize on close (#2596)
* wrap database drivers in order to handle error processing, hooks, etc * remove dead code * add code comment, remove unused blank imports
Diffstat (limited to 'internal/db/bundb/marker.go')
-rw-r--r--internal/db/bundb/marker.go4
1 files changed, 2 insertions, 2 deletions
diff --git a/internal/db/bundb/marker.go b/internal/db/bundb/marker.go
index b1dedb4f1..0ae50f269 100644
--- a/internal/db/bundb/marker.go
+++ b/internal/db/bundb/marker.go
@@ -30,7 +30,7 @@ import (
)
type markerDB struct {
- db *DB
+ db *bun.DB
state *state.State
}
@@ -85,7 +85,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 Tx) error {
+ return m.db.RunInTx(ctx, nil, func(ctx context.Context, tx bun.Tx) error {
result, err := tx.NewUpdate().
Model(marker).
WherePK().