Enable go proxy for downloads

This commit is contained in:
Herman Schaaf
2021-11-12 14:15:09 +00:00
parent 192ddcd676
commit 8e98417165
2 changed files with 10 additions and 10 deletions

View File

@@ -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),