summaryrefslogtreecommitdiff
path: root/internal/db/bundb/timeline.go
diff options
context:
space:
mode:
authorLibravatar Daenney <daenney@users.noreply.github.com>2023-02-17 12:02:29 +0100
committerLibravatar GitHub <noreply@github.com>2023-02-17 12:02:29 +0100
commit68e6d08c768b789987a753d42f66caf73ce10ee1 (patch)
tree1c9eb6da6c326266d653de80684c3aec58922638 /internal/db/bundb/timeline.go
parent[bugfix] Set 'discoverable' properly on API accounts (#1511) (diff)
downloadgotosocial-68e6d08c768b789987a753d42f66caf73ce10ee1.tar.xz
[feature] Add a request ID and include it in logs (#1476)
This adds a lightweight form of tracing to GTS. Each incoming request is assigned a Request ID which we then pass on and log in all our log lines. Any function that gets called downstream from an HTTP handler should now emit a requestID=value pair whenever it logs something. Co-authored-by: kim <grufwub@gmail.com>
Diffstat (limited to 'internal/db/bundb/timeline.go')
-rw-r--r--internal/db/bundb/timeline.go6
1 files changed, 3 insertions, 3 deletions
diff --git a/internal/db/bundb/timeline.go b/internal/db/bundb/timeline.go
index 3340acf94..c499993e3 100644
--- a/internal/db/bundb/timeline.go
+++ b/internal/db/bundb/timeline.go
@@ -114,7 +114,7 @@ func (t *timelineDB) GetHomeTimeline(ctx context.Context, accountID string, maxI
// Fetch status from db for ID
status, err := t.state.DB.GetStatusByID(ctx, id)
if err != nil {
- log.Errorf("GetHomeTimeline: error fetching status %q: %v", id, err)
+ log.Errorf(ctx, "error fetching status %q: %v", id, err)
continue
}
@@ -182,7 +182,7 @@ func (t *timelineDB) GetPublicTimeline(ctx context.Context, maxID string, sinceI
// Fetch status from db for ID
status, err := t.state.DB.GetStatusByID(ctx, id)
if err != nil {
- log.Errorf("GetPublicTimeline: error fetching status %q: %v", id, err)
+ log.Errorf(ctx, "error fetching status %q: %v", id, err)
continue
}
@@ -242,7 +242,7 @@ func (t *timelineDB) GetFavedTimeline(ctx context.Context, accountID string, max
// Fetch status from db for corresponding favourite
status, err := t.state.DB.GetStatusByID(ctx, fave.StatusID)
if err != nil {
- log.Errorf("GetFavedTimeline: error fetching status for fave %q: %v", fave.ID, err)
+ log.Errorf(ctx, "error fetching status for fave %q: %v", fave.ID, err)
continue
}