mirror of
https://github.com/superseriousbusiness/gotosocial.git
synced 2025-11-16 23:27: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 sessionDB struct {
|
||||
db *WrappedDB
|
||||
db *DB
|
||||
}
|
||||
|
||||
func (s *sessionDB) GetSession(ctx context.Context) (*gtsmodel.RouterSession, error) {
|
||||
|
|
@ -40,7 +40,7 @@ func (s *sessionDB) GetSession(ctx context.Context) (*gtsmodel.RouterSession, er
|
|||
Limit(1).
|
||||
Order("router_session.id DESC").
|
||||
Scan(ctx); err != nil {
|
||||
return nil, s.db.ProcessError(err)
|
||||
return nil, err
|
||||
}
|
||||
|
||||
// ... create a new one
|
||||
|
|
@ -70,7 +70,7 @@ func (s *sessionDB) createSession(ctx context.Context) (*gtsmodel.RouterSession,
|
|||
NewInsert().
|
||||
Model(rs).
|
||||
Exec(ctx); err != nil {
|
||||
return nil, s.db.ProcessError(err)
|
||||
return nil, err
|
||||
}
|
||||
|
||||
return rs, nil
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue