summaryrefslogtreecommitdiff
path: root/internal/db/bundb/application.go
diff options
context:
space:
mode:
authorLibravatar kim <89579420+NyaaaWhatsUpDoc@users.noreply.github.com>2023-08-17 17:26:21 +0100
committerLibravatar GitHub <noreply@github.com>2023-08-17 17:26:21 +0100
commitd5d6ad406f47ae738a7f6b1699b3b6e7ef916bb9 (patch)
tree44df2eaf48eca66023023569d4ba8d901d800226 /internal/db/bundb/application.go
parent[chore]: Bump github.com/jackc/pgx/v5 from 5.4.2 to 5.4.3 (#2112) (diff)
downloadgotosocial-d5d6ad406f47ae738a7f6b1699b3b6e7ef916bb9.tar.xz
[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>
Diffstat (limited to 'internal/db/bundb/application.go')
-rw-r--r--internal/db/bundb/application.go8
1 files changed, 4 insertions, 4 deletions
diff --git a/internal/db/bundb/application.go b/internal/db/bundb/application.go
index b53d2c0b0..f7328e275 100644
--- a/internal/db/bundb/application.go
+++ b/internal/db/bundb/application.go
@@ -26,7 +26,7 @@ import (
)
type applicationDB struct {
- db *WrappedDB
+ db *DB
state *state.State
}
@@ -58,7 +58,7 @@ func (a *applicationDB) getApplication(ctx context.Context, lookup string, dbQue
// Not cached! Perform database query.
if err := dbQuery(&app); err != nil {
- return nil, a.db.ProcessError(err)
+ return nil, err
}
return &app, nil
@@ -68,7 +68,7 @@ func (a *applicationDB) getApplication(ctx context.Context, lookup string, dbQue
func (a *applicationDB) PutApplication(ctx context.Context, app *gtsmodel.Application) error {
return a.state.Caches.GTS.Application().Store(app, func() error {
_, err := a.db.NewInsert().Model(app).Exec(ctx)
- return a.db.ProcessError(err)
+ return err
})
}
@@ -78,7 +78,7 @@ func (a *applicationDB) DeleteApplicationByClientID(ctx context.Context, clientI
Table("applications").
Where("? = ?", bun.Ident("client_id"), clientID).
Exec(ctx); err != nil {
- return a.db.ProcessError(err)
+ return err
}
// NOTE about further side effects: