From: Lunny Xiao Date: Sun, 23 Mar 2014 09:51:12 +0000 (+0800) Subject: limit max commits view number on activity X-Git-Tag: v0.9.99~2376 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=d6619cfe15885b7004585bf2b96933a7a3e51f39;p=gitea.git limit max commits view number on activity --- diff --git a/serve.go b/serve.go index bb9165dc06..812c37bb58 100644 --- a/serve.go +++ b/serve.go @@ -262,9 +262,13 @@ func runServ(k *cli.Context) { } commits := make([][]string, 0) + var maxCommits = 5 for e := l.Back(); e != nil; e = e.Prev() { commit := e.Value.(*git.Commit) commits = append(commits, []string{commit.Id().String(), commit.Message()}) + if len(commits) >= maxCommits { + break + } } if err = models.CommitRepoAction(user.Id, user.Name,