cheezy Len fix

This commit is contained in:
Brian Matheson 2019-04-19 10:35:04 +00:00
parent 9b71884b9c
commit 48e9812ba8
1 changed files with 3 additions and 3 deletions

View File

@ -70,9 +70,9 @@ func (q *Queue) Poll() ([]*Pair, error) {
func (q *Queue) Len() (int, error) { func (q *Queue) Len() (int, error) {
prefix := fmt.Sprintf("%s/", q.prefix) prefix := fmt.Sprintf("%s/", q.prefix)
resp, err := q.cli.GetPrefix(prefix, etcd.WithCountOnly()) resp, err := q.cli.GetPrefix(prefix)
fmt.Println("response to Len query is:", resp) fmt.Println("response to Len query for " + prefix + " is:", resp)
return 0, err return len(resp), err
} }
func (q *Queue) Watch(fn func(q *Queue, pair *Pair)) error { func (q *Queue) Watch(fn func(q *Queue, pair *Pair)) error {