|
|
@@ -166,7 +166,7 @@ func RepoStatisticDaily(date string) { |
|
|
|
repoStat.NumIssuesGrowth = repoStat.NumIssues - repoStatisticFourMonthsAgo.NumIssues |
|
|
|
} |
|
|
|
|
|
|
|
SyncStatDataToRepo(repo) |
|
|
|
models.SyncStatDataToRepo(repo) |
|
|
|
|
|
|
|
if _, err = models.InsertRepoStat(&repoStat); err != nil { |
|
|
|
log.Error("InsertRepoStat failed(%s): %v", projectName, err) |
|
|
@@ -286,17 +286,6 @@ func RepoStatisticDaily(date string) { |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
func SyncStatDataToRepo(repo *models.Repository) { |
|
|
|
//Save the visit number of repository in the last month |
|
|
|
if lv, err := models.SumLastMonthNumVisits(repo.ID); err == nil { |
|
|
|
models.UpdateRepositoryLastMonthVisits(repo.ID, lv) |
|
|
|
} |
|
|
|
//Save the commits number of repository in the last four month |
|
|
|
if lc, err := models.SumLastFourMonthNumCommits(repo.ID); err == nil { |
|
|
|
models.UpdateRepositoryLastFourMonthCommits(repo.ID, lc) |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
func getDistinctProjectName(repo *models.Repository) string { |
|
|
|
return repo.OwnerName + "/" + repo.Alias |
|
|
|
} |
|
|
|