diff --git a/models/user_business_analysis.go b/models/user_business_analysis.go index 9da0694a5..a00aef0c8 100644 --- a/models/user_business_analysis.go +++ b/models/user_business_analysis.go @@ -344,13 +344,3 @@ func subMonth(t1, t2 time.Time) (month int) { month = yearInterval*12 + monthInterval return month } - -func QueryAllRepo() []*Repository { - sess := x.NewSession() - defer sess.Close() - sess.Select("*").Table("repository") - repositoryList := make([]*Repository, 0) - sess.Find(&repositoryList) - - return repositoryList -} diff --git a/routers/repo/user_data_analysis.go b/routers/repo/user_data_analysis.go index 13850af7a..2d9c03e1d 100644 --- a/routers/repo/user_data_analysis.go +++ b/routers/repo/user_data_analysis.go @@ -18,7 +18,11 @@ func TimeingCountData() { yesterday := currentTimeNow.AddDate(0, 0, -1) - repoList := models.QueryAllRepo() + repoList, err := models.GetAllRepositories() + if err != nil { + log.Error("query repo error.") + return + } log.Info("start to query wiki data") for _, repoRecord := range repoList { wikiPath := models.WikiPath(repoRecord.OwnerName, repoRecord.Name) diff --git a/templates/explore/dataset_search.tmpl b/templates/explore/dataset_search.tmpl index 6c973026a..aad8f5083 100644 --- a/templates/explore/dataset_search.tmpl +++ b/templates/explore/dataset_search.tmpl @@ -1,12 +1,12 @@