|
|
|
@@ -595,7 +595,11 @@ func Home(ctx *context.Context) { |
|
|
|
startTime := time.Now() |
|
|
|
var contributorInfos []*ContributorInfo |
|
|
|
contributorInfoHash := make(map[string]*ContributorInfo) |
|
|
|
count := 0 |
|
|
|
for _, c := range contributors { |
|
|
|
if count >= 25 { |
|
|
|
continue |
|
|
|
} |
|
|
|
if strings.Compare(c.Email, "") == 0 { |
|
|
|
continue |
|
|
|
} |
|
|
|
@@ -611,6 +615,7 @@ func Home(ctx *context.Context) { |
|
|
|
var newContributor = &ContributorInfo{ |
|
|
|
user, user.Email, c.CommitCnt, |
|
|
|
} |
|
|
|
count++ |
|
|
|
contributorInfos = append(contributorInfos, newContributor) |
|
|
|
contributorInfoHash[user.Email] = newContributor |
|
|
|
} |
|
|
|
@@ -623,6 +628,7 @@ func Home(ctx *context.Context) { |
|
|
|
var newContributor = &ContributorInfo{ |
|
|
|
user, c.Email, c.CommitCnt, |
|
|
|
} |
|
|
|
count++ |
|
|
|
contributorInfos = append(contributorInfos, newContributor) |
|
|
|
contributorInfoHash[c.Email] = newContributor |
|
|
|
} |
|
|
|
@@ -931,6 +937,7 @@ func Contributors(ctx *context.Context) { |
|
|
|
var newContributor = &ContributorInfo{ |
|
|
|
user, user.Email, c.CommitCnt, |
|
|
|
} |
|
|
|
count ++ |
|
|
|
contributorInfos = append(contributorInfos, newContributor) |
|
|
|
contributorInfoHash[user.Email] = newContributor |
|
|
|
} |
|
|
|
@@ -943,12 +950,12 @@ func Contributors(ctx *context.Context) { |
|
|
|
var newContributor = &ContributorInfo{ |
|
|
|
user, c.Email, c.CommitCnt, |
|
|
|
} |
|
|
|
count ++ |
|
|
|
contributorInfos = append(contributorInfos, newContributor) |
|
|
|
contributorInfoHash[c.Email] = newContributor |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
count ++ |
|
|
|
ctx.Data["ContributorInfo"] = contributorInfos |
|
|
|
var duration= time.Since(startTime) |
|
|
|
log.Info("getContributorInfo cost: %v seconds", duration.Seconds()) |
|
|
|
|