Skip to content
This repository has been archived by the owner on Dec 8, 2023. It is now read-only.

Commit

Permalink
Use new zk lib
Browse files Browse the repository at this point in the history
  • Loading branch information
Collin Van Dyck committed Apr 28, 2015
1 parent e13870e commit 1d26c0d
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ gopath = `pwd`

build:
GOPATH=$(gopath) go clean
GOPATH=$(gopath) CGO_LDFLAGS="-lzookeeper_mt" CGO_CFLAGS="-I/usr/include/zookeeper" go build
GOPATH=$(gopath) go build

test: build
test: build
gofmt -e . > /dev/null
GOPATH=$(gopath) go test -v .
GOPATH=$(gopath) go vet
Expand Down
10 changes: 5 additions & 5 deletions rollout.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import (
"sync"
"time"

"github.com/librato/gozk"
"github.com/samuel/go-zookeeper/zk"
)

type Client interface {
Expand All @@ -22,7 +22,7 @@ type Client interface {
type errorHandlerFunc func(err error)

type client struct {
zk *zookeeper.Conn
zk *zk.Conn
currentData map[string]string
mutex sync.RWMutex
stop chan bool
Expand All @@ -31,7 +31,7 @@ type client struct {
errorHandler errorHandlerFunc
}

func NewClient(zk *zookeeper.Conn, path string, errorHandler errorHandlerFunc) Client {
func NewClient(zk *zk.Conn, path string, errorHandler errorHandlerFunc) Client {
r := client{
zk: zk,
path: path,
Expand All @@ -45,11 +45,11 @@ func NewClient(zk *zookeeper.Conn, path string, errorHandler errorHandlerFunc) C

func (r *client) Start() error {
log.Printf("Starting Rollout service on %s", r.path)
stat, err := r.zk.Exists(r.path)
exists, _, err := r.zk.Exists(r.path)
if err != nil {
return err
}
if stat == nil {
if !exists {
return fmt.Errorf("Rollout path (%s) does not exist", r.path)
}

Expand Down

0 comments on commit 1d26c0d

Please sign in to comment.