From 020db9411ec6bc530941290945e287764bf4545b Mon Sep 17 00:00:00 2001 From: Anirudh Oppiliappan Date: Fri, 28 Mar 2025 23:09:28 +0200 Subject: [PATCH] appview: profile: limit events to 30 --- appview/db/profile.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/appview/db/profile.go b/appview/db/profile.go index abc905e4..ef4c3331 100644 --- a/appview/db/profile.go +++ b/appview/db/profile.go @@ -15,6 +15,7 @@ type ProfileTimelineEvent struct { func MakeProfileTimeline(e Execer, forDid string) ([]ProfileTimelineEvent, error) { timeline := []ProfileTimelineEvent{} + limit := 30 pulls, err := GetPullsByOwnerDid(e, forDid) if err != nil { @@ -71,5 +72,9 @@ func MakeProfileTimeline(e Execer, forDid string) ([]ProfileTimelineEvent, error return timeline[i].EventAt.After(timeline[j].EventAt) }) + if len(timeline) > limit { + timeline = timeline[:limit] + } + return timeline, nil } -- 2.51.2