mirror of
https://github.com/gojp/goreportcard.git
synced 2026-01-28 22:39:05 +08:00
Enable go proxy for downloads
This commit is contained in:
@@ -90,17 +90,17 @@ func newChecksResp(db *badger.DB, repo string, forceRefresh bool) (checksResp, e
|
|||||||
}
|
}
|
||||||
|
|
||||||
// fetch the repo and grade it
|
// fetch the repo and grade it
|
||||||
repoRoot, err := download.Download(repo, "_repos/src")
|
//repoRoot, err := download.Download(repo, "_repos/src")
|
||||||
|
//if err != nil {
|
||||||
|
// return checksResp{}, fmt.Errorf("could not clone repo: %v", err)
|
||||||
|
//}
|
||||||
|
|
||||||
|
err := download.ProxyDownload(repo)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return checksResp{}, fmt.Errorf("could not clone repo: %v", err)
|
fmt.Println("ERROR:", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
// err = download.ProxyDownload(repo)
|
// repo = repoRoot.Root
|
||||||
// if err != nil {
|
|
||||||
// fmt.Println("ERROR:", err)
|
|
||||||
// }
|
|
||||||
|
|
||||||
repo = repoRoot.Root
|
|
||||||
checkResult, err := check.Run(dirName(repo))
|
checkResult, err := check.Run(dirName(repo))
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return checksResp{}, err
|
return checksResp{}, err
|
||||||
@@ -114,7 +114,7 @@ func newChecksResp(db *badger.DB, repo string, forceRefresh bool) (checksResp, e
|
|||||||
Files: checkResult.Files,
|
Files: checkResult.Files,
|
||||||
Issues: checkResult.Issues,
|
Issues: checkResult.Issues,
|
||||||
Repo: repo,
|
Repo: repo,
|
||||||
ResolvedRepo: repoRoot.Repo,
|
ResolvedRepo: repo,
|
||||||
LastRefresh: t,
|
LastRefresh: t,
|
||||||
LastRefreshFormatted: t.Format(time.UnixDate),
|
LastRefreshFormatted: t.Format(time.UnixDate),
|
||||||
LastRefreshHumanized: humanize.Time(t),
|
LastRefreshHumanized: humanize.Time(t),
|
||||||
|
|||||||
Reference in New Issue
Block a user