MCPcopy Create free account
hub / github.com/alibaba/open-code-review / New

Function New

internal/gitcmd/runner.go:25–30  ·  view source on GitHub ↗

New creates a Runner that allows at most maxConcurrent simultaneous git subprocesses. If maxConcurrent <= 0 the default (16) is used.

(maxConcurrent int)

Source from the content-addressed store, hash-verified

23// New creates a Runner that allows at most maxConcurrent simultaneous git
24// subprocesses. If maxConcurrent <= 0 the default (16) is used.
25func New(maxConcurrent int) *Runner {
26 if maxConcurrent <= 0 {
27 maxConcurrent = defaultMaxConcurrent
28 }
29 return &Runner{sem: make(chan struct{}, maxConcurrent)}
30}
31
32func (r *Runner) acquire(ctx context.Context) error {
33 if r.sem == nil {

Calls

no outgoing calls