Skip to content
This repository has been archived by the owner on May 6, 2022. It is now read-only.

Commit

Permalink
remove dupl chl close
Browse files Browse the repository at this point in the history
  • Loading branch information
srinandan committed Aug 4, 2019
1 parent b297a3c commit ef35a6e
Show file tree
Hide file tree
Showing 5 changed files with 22 additions and 4 deletions.
1 change: 0 additions & 1 deletion cmd/apis/impapis/impapis.go
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,6 @@ func createAPIs(u *url.URL) error {
}
go func() {
wg.Wait()
close(errChan)
}()
}

Expand Down
1 change: 0 additions & 1 deletion cmd/apps/impapps/impapps.go
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,6 @@ func createApps() error {
}
go func() {
wg.Wait()
close(errChan)
}()
}

Expand Down
1 change: 0 additions & 1 deletion cmd/developers/impdev/impdev.go
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,6 @@ func createDevelopers(url string) error {
}
go func() {
wg.Wait()
close(errChan)
}()
}

Expand Down
22 changes: 22 additions & 0 deletions cmd/products/expprod/expprod.go
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,28 @@ func exportProducts() error {
wg.Wait()
close(errChan)
}()
} else {
numOfLoops, remaining := numProd/conn, numProd%conn
for i := 0; i < numOfLoops; i++ {
shared.Info.Printf("Create %d batch of products\n", i)
wg.Add(conn)
for j := 0; j < conn; j++ {
go shared.GetAsyncEntity(url.PathEscape(products.APIProducts[j+(i*conn)].Name), entityType, &wg, &mu, errChan)
}
go func() {
wg.Wait()
}()
}

wg.Add(remaining)
shared.Info.Printf("Create remaining %d products\n", remaining)
for i := (numProd - remaining); i < numProd; i++ {
go shared.GetAsyncEntity(url.PathEscape(products.APIProducts[i].Name), entityType, &wg, &mu, errChan)
}
go func() {
wg.Wait()
close(errChan)
}()
}

//print any errors and return an err
Expand Down
1 change: 0 additions & 1 deletion cmd/products/impprod/impprod.go
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,6 @@ func createProducts(url string) error {
}
go func() {
wg.Wait()
close(errChan)
}()
}

Expand Down

0 comments on commit ef35a6e

Please sign in to comment.