summaryrefslogtreecommitdiff
path: root/internal/db/bundb/list.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/list.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/list.go')
-rw-r--r--internal/db/bundb/list.go6
1 files changed, 3 insertions, 3 deletions
diff --git a/internal/db/bundb/list.go b/internal/db/bundb/list.go
index 5f95d3c24..fb97c8fe7 100644
--- a/internal/db/bundb/list.go
+++ b/internal/db/bundb/list.go
@@ -35,7 +35,7 @@ import (
)
type listDB struct {
- db *DB
+ db *bun.DB
state *state.State
}
@@ -198,7 +198,7 @@ func (l *listDB) DeleteListByID(ctx context.Context, id string) error {
}
}()
- return l.db.RunInTx(ctx, func(tx Tx) error {
+ return l.db.RunInTx(ctx, nil, func(ctx context.Context, tx bun.Tx) error {
// Delete all entries attached to list.
if _, err := tx.NewDelete().
Table("list_entries").
@@ -515,7 +515,7 @@ func (l *listDB) PutListEntries(ctx context.Context, entries []*gtsmodel.ListEnt
}()
// Finally, insert each list entry into the database.
- return l.db.RunInTx(ctx, func(tx Tx) error {
+ return l.db.RunInTx(ctx, nil, func(ctx context.Context, tx bun.Tx) error {
for _, entry := range entries {
entry := entry // rescope
if err := l.state.Caches.GTS.ListEntry.Store(entry, func() error {