mirror of
https://github.com/superseriousbusiness/gotosocial.git
synced 2025-11-26 00:13:33 -06:00
[bugfix] fix double firing bun.DB query hooks (#2124)
* improve bun.DB wrapping readability + comments, fix double-firing query hooks * fix incorrect code comment placement * fix linter issues * Update internal/db/basic.go * do as the linter commmands ... --------- Signed-off-by: kim <grufwub@gmail.com> Co-authored-by: Daenney <daenney@users.noreply.github.com>
This commit is contained in:
parent
e70629e856
commit
d5d6ad406f
44 changed files with 645 additions and 535 deletions
|
|
@ -27,7 +27,7 @@ import (
|
|||
)
|
||||
|
||||
type tombstoneDB struct {
|
||||
db *WrappedDB
|
||||
db *DB
|
||||
state *state.State
|
||||
}
|
||||
|
||||
|
|
@ -41,7 +41,7 @@ func (t *tombstoneDB) GetTombstoneByURI(ctx context.Context, uri string) (*gtsmo
|
|||
Where("? = ?", bun.Ident("tombstone.uri"), uri)
|
||||
|
||||
if err := q.Scan(ctx); err != nil {
|
||||
return nil, t.db.ProcessError(err)
|
||||
return nil, err
|
||||
}
|
||||
|
||||
return &tomb, nil
|
||||
|
|
@ -62,7 +62,7 @@ func (t *tombstoneDB) PutTombstone(ctx context.Context, tombstone *gtsmodel.Tomb
|
|||
NewInsert().
|
||||
Model(tombstone).
|
||||
Exec(ctx)
|
||||
return t.db.ProcessError(err)
|
||||
return err
|
||||
})
|
||||
}
|
||||
|
||||
|
|
@ -74,5 +74,5 @@ func (t *tombstoneDB) DeleteTombstone(ctx context.Context, id string) error {
|
|||
TableExpr("? AS ?", bun.Ident("tombstones"), bun.Ident("tombstone")).
|
||||
Where("? = ?", bun.Ident("tombstone.id"), id).
|
||||
Exec(ctx)
|
||||
return t.db.ProcessError(err)
|
||||
return err
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue