cheezy Len fix
This commit is contained in:
parent
9b71884b9c
commit
48e9812ba8
6
queue.go
6
queue.go
|
@ -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 {
|
||||||
|
|
Loading…
Reference in New Issue