Limit number of timeline items with SQL
This commit is contained in:
parent
3a492059de
commit
df0e57f4cc
|
@ -308,13 +308,12 @@ func ProjectHomepage(c *RequestContext) ResponseData {
|
||||||
|
|
||||||
templateData.RecentActivity, err = FetchTimeline(c, c.Conn, c.CurrentUser, lineageBuilder, hmndata.TimelineQuery{
|
templateData.RecentActivity, err = FetchTimeline(c, c.Conn, c.CurrentUser, lineageBuilder, hmndata.TimelineQuery{
|
||||||
ProjectIDs: []int{c.CurrentProject.ID},
|
ProjectIDs: []int{c.CurrentProject.ID},
|
||||||
|
Limit: maxRecentActivity,
|
||||||
})
|
})
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return c.ErrorResponse(http.StatusInternalServerError, err)
|
return c.ErrorResponse(http.StatusInternalServerError, err)
|
||||||
}
|
}
|
||||||
|
|
||||||
templateData.RecentActivity = utils.ClampSlice(templateData.RecentActivity, maxRecentActivity)
|
|
||||||
|
|
||||||
followUrl := ""
|
followUrl := ""
|
||||||
following := false
|
following := false
|
||||||
if c.CurrentUser != nil {
|
if c.CurrentUser != nil {
|
||||||
|
|
Loading…
Reference in New Issue