Skip to content
Permalink
Browse files

feat: add `cfg.Goproxy.MaxGoBinWorkers`

  • Loading branch information...
aofei committed Oct 1, 2019
1 parent 9b40106 commit dc6fae9c20d9c26a70ee6bb242d2cbd8fa6a4623
Showing with 10 additions and 0 deletions.
  1. +5 −0 cfg/cfg.go
  2. +1 −0 config.toml
  3. +1 −0 go.mod
  4. +2 −0 go.sum
  5. +1 −0 handler/handler.go
@@ -47,6 +47,11 @@ var (
// GoBinName is the name of the Go binary of the Goproxy.
GoBinName string `mapstructure:"go_bin_name"`

// MaxGoBinWorkers is the maximum number of the Go binary
// commands that are allowed to execute at the same time of the
// Goproxy.
MaxGoBinWorkers int `mapstructure:"max_go_bin_workers"`

// MaxZIPCacheBytes is the maximum number of bytes of the ZIP
// cache that will be stored in the cacher of the Goproxy.
MaxZIPCacheBytes int `mapstructure:"max_zip_cache_bytes"`
@@ -23,5 +23,6 @@ bucket_endpoint = "<BUCKET_ENDPOINT>"
# Goproxy
[goproxy]
go_bin_name = "go"
max_go_bin_workers = 8
max_zip_cache_bytes = 104857600
local_cache_root = "/tmp"
1 go.mod
@@ -14,5 +14,6 @@ require (
github.com/mitchellh/mapstructure v1.1.2
github.com/qiniu/api.v7 v0.0.0-20190520053455-bea02cd22bf4
github.com/rs/zerolog v1.15.0
golang.org/x/sys v0.0.0-20191001151750-bb3f8db39f24 // indirect
google.golang.org/appengine v1.6.4 // indirect
)
2 go.sum
@@ -127,6 +127,8 @@ golang.org/x/sys v0.0.0-20190913121621-c3b328c6e5a7 h1:wYqz/tQaWUgGKyx+B/rssSE6w
golang.org/x/sys v0.0.0-20190913121621-c3b328c6e5a7/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20190927073244-c990c680b611 h1:q9u40nxWT5zRClI/uU9dHCiYGottAg6Nzz4YUQyHxdA=
golang.org/x/sys v0.0.0-20190927073244-c990c680b611/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20191001151750-bb3f8db39f24 h1:R8bzl0244nw47n1xKs1MUMAaTNgjavKcN/aX2Ss3+Fo=
golang.org/x/sys v0.0.0-20191001151750-bb3f8db39f24/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
golang.org/x/text v0.3.2 h1:tW2bmiBqwgJj/UpqtC8EpXEZVYOwU0yG4iWbprSVAcs=
golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk=
@@ -47,6 +47,7 @@ var (

func init() {
g.GoBinName = cfg.Goproxy.GoBinName
g.MaxGoBinWorkers = cfg.Goproxy.MaxGoBinWorkers
g.Cacher = &kodoCacher{
kodoCacher: &cacher.Kodo{
Endpoint: cfg.Kodo.Endpoint,

0 comments on commit dc6fae9

Please sign in to comment.
You can’t perform that action at this time.