From d5d6ad406f47ae738a7f6b1699b3b6e7ef916bb9 Mon Sep 17 00:00:00 2001 From: kim <89579420+NyaaaWhatsUpDoc@users.noreply.github.com> Date: Thu, 17 Aug 2023 17:26:21 +0100 Subject: [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 Co-authored-by: Daenney --- internal/db/bundb/session.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'internal/db/bundb/session.go') diff --git a/internal/db/bundb/session.go b/internal/db/bundb/session.go index 8d778ffa2..9310a6463 100644 --- a/internal/db/bundb/session.go +++ b/internal/db/bundb/session.go @@ -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 -- cgit v1.2.3