internal/postgres: make large modules limit configurable

Change-Id: Iafeb3727f1d48ed37d10d64db6e39f26db590f29
Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/256761
Trust: Jonathan Amsterdam <jba@google.com>
Run-TryBot: Jonathan Amsterdam <jba@google.com>
TryBot-Result: kokoro <noreply+kokoro@google.com>
Reviewed-by: Julie Qiu <julie@golang.org>
diff --git a/internal/postgres/requeue.go b/internal/postgres/requeue.go
index 68ab82c..4cc2c9a 100644
--- a/internal/postgres/requeue.go
+++ b/internal/postgres/requeue.go
@@ -12,6 +12,7 @@
 	"strconv"
 
 	"golang.org/x/pkgsite/internal"
+	"golang.org/x/pkgsite/internal/config"
 	"golang.org/x/pkgsite/internal/derrors"
 	"golang.org/x/pkgsite/internal/log"
 )
@@ -61,7 +62,7 @@
 // largeModulesLimit represents the number of large modules that we are
 // willing to enqueue at a given time.
 // var for testing.
-var largeModulesLimit = 100
+var largeModulesLimit = config.GetEnvInt("GO_DISCOVERY_LARGE_MODULES_LIMIT", 100)
 
 // GetNextModulesToFetch returns the next batch of modules that need to be
 // processed. We prioritize modules based on (1) whether it has status zero