diff options
author | 2023-08-31 10:46:15 +0100 | |
---|---|---|
committer | 2023-08-31 11:46:15 +0200 | |
commit | 1ee99fc16583e4cefc46011dbc63ca8ed91d3189 (patch) | |
tree | 950b661bb7c7b4cdb5057ee824ba75ae15fd3adc /internal/db/bundb/list.go | |
parent | [chore]: Bump github.com/google/uuid from 1.3.0 to 1.3.1 (#2166) (diff) | |
download | gotosocial-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/list.go')
-rw-r--r-- | internal/db/bundb/list.go | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/internal/db/bundb/list.go b/internal/db/bundb/list.go index 23d9c13fb..7a117670a 100644 --- a/internal/db/bundb/list.go +++ b/internal/db/bundb/list.go @@ -206,7 +206,7 @@ func (l *listDB) DeleteListByID(ctx context.Context, id string) error { } }() - return l.db.RunInTx(ctx, func(tx bun.Tx) error { + return l.db.RunInTx(ctx, func(tx Tx) error { // Delete all entries attached to list. if _, err := tx.NewDelete(). Table("list_entries"). @@ -423,7 +423,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 bun.Tx) error { + return l.db.RunInTx(ctx, func(tx Tx) error { for _, entry := range entries { entry := entry // rescope if err := l.state.Caches.GTS.ListEntry().Store(entry, func() error { |