From cc85fc276443aadea042b8aedb0367c4fb8dc3dc Mon Sep 17 00:00:00 2001 From: zouap Date: Fri, 8 Oct 2021 17:35:24 +0800 Subject: [PATCH] =?UTF-8?q?=E6=8F=90=E4=BA=A4=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: zouap --- routers/repo/user_data_analysis.go | 21 +++++++++++++-------- 1 file changed, 13 insertions(+), 8 deletions(-) diff --git a/routers/repo/user_data_analysis.go b/routers/repo/user_data_analysis.go index aecc7db60..fcda7de79 100644 --- a/routers/repo/user_data_analysis.go +++ b/routers/repo/user_data_analysis.go @@ -31,16 +31,21 @@ func TimeingCountData() { log.Error("wiki not exist. wikiPath=" + wikiPath) } else { log.Info("wiki exist, wikiPath=" + wikiPath) - list, _ := wikiRepo.GetCommitByPathAndDays(wikiPath, 1) - for logEntry := list.Front(); logEntry != nil; logEntry = logEntry.Next() { - commit := logEntry.Value.(*git.Commit) - log.Info("commit msg=" + commit.CommitMessage + " time=" + commit.Committer.When.Format("2006-01-02 15:04:05")) - if _, ok := wikiMap[commit.Committer.Name]; !ok { - wikiMap[commit.Committer.Name] = 0 - } else { - wikiMap[commit.Committer.Name] += 1 + list, err := wikiRepo.GetCommitByPathAndDays(wikiPath, 1) + if err != nil { + log.Info("err,err=v%", err) + } else { + for logEntry := list.Front(); logEntry != nil; logEntry = logEntry.Next() { + commit := logEntry.Value.(*git.Commit) + log.Info("commit msg=" + commit.CommitMessage + " time=" + commit.Committer.When.Format("2006-01-02 15:04:05")) + if _, ok := wikiMap[commit.Committer.Name]; !ok { + wikiMap[commit.Committer.Name] = 0 + } else { + wikiMap[commit.Committer.Name] += 1 + } } } + } } }