|
|
@@ -12,6 +12,7 @@ import ( |
|
|
|
"code.gitea.io/gitea/modules/git" |
|
|
|
"code.gitea.io/gitea/modules/log" |
|
|
|
"code.gitea.io/gitea/modules/setting" |
|
|
|
"code.gitea.io/gitea/services/mailer" |
|
|
|
"github.com/360EntSecGroup-Skylar/excelize/v2" |
|
|
|
) |
|
|
|
|
|
|
@@ -142,10 +143,11 @@ func TimingCountDataByDateAndReCount(date string, isReCount bool) { |
|
|
|
//query wiki data |
|
|
|
log.Info("start to time count data") |
|
|
|
wikiMap := make(map[string]int) |
|
|
|
|
|
|
|
warnEmailMessage := "用户统计信息入库失败,请尽快定位。" |
|
|
|
repoList, err := models.GetAllRepositories() |
|
|
|
if err != nil { |
|
|
|
log.Error("query repo error.") |
|
|
|
log.Error("query repo error." + err.Error()) |
|
|
|
mailer.SendWarnNotifyMail(setting.Warn_Notify_Mails, warnEmailMessage) |
|
|
|
return |
|
|
|
} |
|
|
|
log.Info("start to query wiki data") |
|
|
@@ -180,7 +182,11 @@ func TimingCountDataByDateAndReCount(date string, isReCount bool) { |
|
|
|
} |
|
|
|
} |
|
|
|
//other user info data |
|
|
|
models.CounDataByDateAndReCount(wikiMap, startTime, endTime, isReCount) |
|
|
|
err = models.CounDataByDateAndReCount(wikiMap, startTime, endTime, isReCount) |
|
|
|
if err != nil { |
|
|
|
log.Error("count user info error." + err.Error()) |
|
|
|
mailer.SendWarnNotifyMail(setting.Warn_Notify_Mails, warnEmailMessage) |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
func TimingCountDataByDate(date string) { |
|
|
|