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

Commit

Permalink
fixed conflicts
Browse files Browse the repository at this point in the history
  • Loading branch information
yuce committed Feb 15, 2018
2 parents a8b89de + b48f94c commit 5a69cc6
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 5 deletions.
14 changes: 13 additions & 1 deletion Gopkg.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

14 changes: 10 additions & 4 deletions client.go
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ import (
"github.com/golang/protobuf/proto"
pbuf "github.com/pilosa/go-pilosa/gopilosa_pbuf"
"github.com/pkg/errors"
"golang.org/x/sync/errgroup"
)

const maxHosts = 10
Expand Down Expand Up @@ -524,8 +525,10 @@ func (c *Client) importBits(indexName string, frameName string, slice uint64, bi
sort.Sort(bitsForSort(bits))
nodes, err := c.fetchFragmentNodes(indexName, slice)
if err != nil {
return err
return errors.Wrap(err, "fetching fragment nodes")
}

eg := errgroup.Group{}
for _, node := range nodes {
uri := &URI{
scheme: node.Scheme,
Expand All @@ -534,11 +537,14 @@ func (c *Client) importBits(indexName string, frameName string, slice uint64, bi
}
err = c.importNode(uri, bitsToImportRequest(indexName, frameName, slice, bits))
if err != nil {
return err
return errors.Wrap(err, "setting scheme on uri")
}
eg.Go(func() error {
return c.importNode(uri, bitsToImportRequest(indexName, frameName, slice, bits))
})
}

return nil
err = eg.Wait()
return errors.Wrap(err, "importing to nodes")
}

func (c *Client) importBitsK(indexName string, frameName string, bits []Bit) error {
Expand Down

0 comments on commit 5a69cc6

Please sign in to comment.