summaryrefslogtreecommitdiff
path: root/internal/db/bundb/timeline.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/timeline.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/timeline.go')
-rw-r--r--internal/db/bundb/timeline.go12
1 files changed, 6 insertions, 6 deletions
diff --git a/internal/db/bundb/timeline.go b/internal/db/bundb/timeline.go
index 62f1f642d..1230a84d4 100644
--- a/internal/db/bundb/timeline.go
+++ b/internal/db/bundb/timeline.go
@@ -33,7 +33,7 @@ import (
)
type timelineDB struct {
- db *WrappedDB
+ db *DB
state *state.State
}
@@ -119,7 +119,7 @@ func (t *timelineDB) GetHomeTimeline(ctx context.Context, accountID string, maxI
})
if err := q.Scan(ctx, &statusIDs); err != nil {
- return nil, t.db.ProcessError(err)
+ return nil, err
}
if len(statusIDs) == 0 {
@@ -202,7 +202,7 @@ func (t *timelineDB) GetPublicTimeline(ctx context.Context, maxID string, sinceI
}
if err := q.Scan(ctx, &statusIDs); err != nil {
- return nil, t.db.ProcessError(err)
+ return nil, err
}
statuses := make([]*gtsmodel.Status, 0, len(statusIDs))
@@ -253,7 +253,7 @@ func (t *timelineDB) GetFavedTimeline(ctx context.Context, accountID string, max
err := fq.Scan(ctx)
if err != nil {
- return nil, "", "", t.db.ProcessError(err)
+ return nil, "", "", err
}
if len(faves) == 0 {
@@ -379,7 +379,7 @@ func (t *timelineDB) GetListTimeline(
}
if err := q.Scan(ctx, &statusIDs); err != nil {
- return nil, t.db.ProcessError(err)
+ return nil, err
}
if len(statusIDs) == 0 {
@@ -487,7 +487,7 @@ func (t *timelineDB) GetTagTimeline(
}
if err := q.Scan(ctx, &statusIDs); err != nil {
- return nil, t.db.ProcessError(err)
+ return nil, err
}
if len(statusIDs) == 0 {