cmd/worker: remove the proxy-removed list
We no longer need a special list of removed modules, because the
disable-fetch header serves the same purpose.
Change-Id: Ia52a5cfc1036127b78d36f668917809952c57e81
Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/341532
Trust: Jonathan Amsterdam <jba@google.com>
Run-TryBot: Jonathan Amsterdam <jba@google.com>
TryBot-Result: kokoro <noreply+kokoro@google.com>
Reviewed-by: Jamal Carvalho <jamal@golang.org>
Reviewed-by: Julie Qiu <julie@golang.org>
diff --git a/cmd/worker/main.go b/cmd/worker/main.go
index 04cf38d..f71800a 100644
--- a/cmd/worker/main.go
+++ b/cmd/worker/main.go
@@ -59,8 +59,6 @@
}
}
- readProxyRemoved(ctx)
-
db, err := cmdconfig.OpenDB(ctx, cfg, *bypassLicenseCheck)
if err != nil {
log.Fatalf(ctx, "%v", err)
@@ -173,25 +171,6 @@
})
}
-// Read a file of module versions that we should ignore because
-// the are in the index but not stored in the proxy.
-// Format of the file: each line is
-// module@version
-func readProxyRemoved(ctx context.Context) {
- filename := config.GetEnv("GO_DISCOVERY_PROXY_REMOVED", "")
- if filename == "" {
- return
- }
- lines, err := internal.ReadFileLines(filename)
- if err != nil {
- log.Fatal(ctx, err)
- }
- for _, line := range lines {
- worker.ProxyRemoved[line] = true
- }
- log.Infof(ctx, "read %d excluded module versions from %s", len(worker.ProxyRemoved), filename)
-}
-
// populateExcluded adds each element of excludedPrefixes to the excluded_prefixes
// table if it isn't already present.
func populateExcluded(ctx context.Context, db *postgres.DB) {
diff --git a/internal/worker/fetch.go b/internal/worker/fetch.go
index d482ef8..15e8ef4 100644
--- a/internal/worker/fetch.go
+++ b/internal/worker/fetch.go
@@ -29,10 +29,6 @@
"golang.org/x/pkgsite/internal/stdlib"
)
-// ProxyRemoved is a set of module@version that have been removed from the proxy,
-// even though they are still in the index.
-var ProxyRemoved = map[string]bool{}
-
// fetchTask represents the result of a fetch task that was processed.
type fetchTask struct {
fetch.FetchResult
@@ -179,12 +175,6 @@
}
}()
- if ProxyRemoved[modulePath+"@"+requestedVersion] {
- log.Infof(ctx, "not fetching %s@%s because it is on the ProxyRemoved list", modulePath, requestedVersion)
- ft.Error = derrors.Excluded
- return ft
- }
-
exc, err := f.DB.IsExcluded(ctx, modulePath)
if err != nil {
ft.Error = err