examples/server/distributed: address comment in #380
I failed to push my branch before merging #380. Address one minor comment from that PR.
This commit is contained in:
parent
0bb1a42b53
commit
c76d991f05
1 changed files with 2 additions and 1 deletions
|
|
@ -80,7 +80,6 @@ func parent() {
|
|||
var wg sync.WaitGroup
|
||||
childURLs := make([]*url.URL, len(ports))
|
||||
for i, port := range ports {
|
||||
wg.Add(1)
|
||||
childURL := fmt.Sprintf("http://localhost:%s", port)
|
||||
childURLs[i], err = url.Parse(childURL)
|
||||
if err != nil {
|
||||
|
|
@ -89,6 +88,8 @@ func parent() {
|
|||
cmd := exec.CommandContext(ctx, exe, os.Args[1:]...)
|
||||
cmd.Env = append(os.Environ(), fmt.Sprintf("%s=%s", childPortVar, port))
|
||||
cmd.Stderr = os.Stderr
|
||||
|
||||
wg.Add(1)
|
||||
go func() {
|
||||
defer wg.Done()
|
||||
log.Printf("starting child %d at %s", i, childURL)
|
||||
|
|
|
|||
Loading…
Reference in a new issue