diff options
author | 2024-02-07 14:43:27 +0000 | |
---|---|---|
committer | 2024-02-07 14:43:27 +0000 | |
commit | 6738fd5bb0193daf3e2b524105ff690e8bfc32f4 (patch) | |
tree | 1c9b84846e21c737746f2a528170ad1d4bfb0a1c /internal/db/bundb/media.go | |
parent | [bugfix] Ensure activities sender always = activities actor (#2608) (diff) | |
download | gotosocial-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/media.go')
-rw-r--r-- | internal/db/bundb/media.go | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/internal/db/bundb/media.go b/internal/db/bundb/media.go index ced38a588..99ef30d22 100644 --- a/internal/db/bundb/media.go +++ b/internal/db/bundb/media.go @@ -34,7 +34,7 @@ import ( ) type mediaDB struct { - db *DB + db *bun.DB state *state.State } @@ -151,7 +151,7 @@ func (m *mediaDB) DeleteAttachment(ctx context.Context, id string) error { defer m.state.Caches.GTS.Media.Invalidate("ID", id) // Delete media attachment in new transaction. - err = m.db.RunInTx(ctx, func(tx Tx) error { + err = m.db.RunInTx(ctx, nil, func(ctx context.Context, tx bun.Tx) error { if media.AccountID != "" { var account gtsmodel.Account |