Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

clarkbynum
Copy link
Contributor

…rors for collection create; short-circuit the import early to make it faster to test; add sleeps to simulate a slow network

…rors for collection create; short-circuit the import early to make it faster to test; add sleeps to simulate a slow network
fmt.Printf(" %s\n", collection["name"].(string))
pool.Submit(func() {
if info, err := CreateCollection(systemInfo.Key, collection, config.ImportRows, client); err == nil {
group.Submit(func() error {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

After glancing over the pond docs, creating a group seemed like the only way you can handle errors

@clarkbynum clarkbynum requested a review from andrewhdev January 10, 2023 23:48
group, _ := pool.GroupContext(context.Background())

for _, collection := range collections {
collection := collection
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looking at pond's docs, I noticed that their examples reassign the loop variable so that it stays in scope when the Submit callback is called

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant