mirror of
https://github.com/superseriousbusiness/gotosocial.git
synced 2025-11-15 08:17:30 -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
|
|
@ -49,7 +49,7 @@ func (r *relationshipDB) getNote(ctx context.Context, lookup string, dbQuery fun
|
|||
|
||||
// Not cached! Perform database query
|
||||
if err := dbQuery(¬e); err != nil {
|
||||
return nil, r.db.ProcessError(err)
|
||||
return nil, err
|
||||
}
|
||||
|
||||
return ¬e, nil
|
||||
|
|
@ -94,6 +94,6 @@ func (r *relationshipDB) PutNote(ctx context.Context, note *gtsmodel.AccountNote
|
|||
On("CONFLICT (?, ?) DO UPDATE", bun.Ident("account_id"), bun.Ident("target_account_id")).
|
||||
Set("? = ?, ? = ?", bun.Ident("updated_at"), note.UpdatedAt, bun.Ident("comment"), note.Comment).
|
||||
Exec(ctx)
|
||||
return r.db.ProcessError(err)
|
||||
return err
|
||||
})
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue