|
|
|
@@ -39,8 +39,35 @@ func UpdateAllRepoCommitCnt(ctx *macaron.Context) { |
|
|
|
} |
|
|
|
|
|
|
|
func RepoStatisticManually(ctx *macaron.Context) { |
|
|
|
date := ctx.Query("date") |
|
|
|
date := ctx.Params("date") |
|
|
|
repo.RepoStatisticDaily(date) |
|
|
|
repo.SummaryStatisticDaily(date) |
|
|
|
repo.TimingCountDataByDate(date) |
|
|
|
} |
|
|
|
|
|
|
|
func UpdateRepoVisit(ctx *macaron.Context) { |
|
|
|
date := ctx.Params("date") |
|
|
|
log.Info("date(%s)", date) |
|
|
|
|
|
|
|
repos, err := models.GetAllRepositories() |
|
|
|
if err != nil { |
|
|
|
log.Error("GetAllRepositories failed:%v", err.Error(), ctx.Data["MsgID"]) |
|
|
|
ctx.JSON(http.StatusInternalServerError, map[string]string{ |
|
|
|
"error_msg": "GetAllRepositories failed", |
|
|
|
}) |
|
|
|
return |
|
|
|
} |
|
|
|
|
|
|
|
for i, repoStat := range repos { |
|
|
|
log.Info("%d:begin UpdateRepoVisits(id = %d, name = %s)", i, repoStat.ID, repoStat.Name) |
|
|
|
if err = repo.UpdateRepoVisits(ctx, repoStat, date); err != nil { |
|
|
|
log.Error("UpdateRepoVisits(id = %d, name = %s) failed:%v", repoStat.ID, repoStat.Name, err.Error()) |
|
|
|
continue |
|
|
|
} |
|
|
|
log.Info("%d:finish UpdateRepoVisits(id = %d, name = %s)", i, repoStat.ID, repoStat.Name) |
|
|
|
} |
|
|
|
|
|
|
|
ctx.JSON(http.StatusOK, map[string]string{ |
|
|
|
"error_msg": "", |
|
|
|
}) |
|
|
|
} |