Updating zookeeper dependency since logging problem has been solved in main repository. Go fmt run on project to tidy it up.

This commit is contained in:
Renan DelValle 2016-11-02 20:41:43 -04:00
parent b3e55be98b
commit 3bf2e8a831
13 changed files with 296 additions and 152 deletions

View file

@ -58,8 +58,16 @@ func (l *Lock) Lock() error {
parts := strings.Split(l.path, "/")
pth := ""
for _, p := range parts[1:] {
var exists bool
pth += "/" + p
_, err := l.c.Create(pth, []byte{}, 0, l.acl)
exists, _, err = l.c.Exists(pth)
if err != nil {
return err
}
if exists == true {
continue
}
_, err = l.c.Create(pth, []byte{}, 0, l.acl)
if err != nil && err != ErrNodeExists {
return err
}
@ -86,7 +94,7 @@ func (l *Lock) Lock() error {
}
lowestSeq := seq
prevSeq := 0
prevSeq := -1
prevSeqPath := ""
for _, p := range children {
s, err := parseSeq(p)