()
| 82 | } |
| 83 | |
| 84 | func (j *Jodis) Rewatch() (<-chan struct{}, error) { |
| 85 | j.mu.Lock() |
| 86 | defer j.mu.Unlock() |
| 87 | if j.closed { |
| 88 | return nil, ErrClosedJodis |
| 89 | } |
| 90 | w, err := j.client.CreateEphemeral(j.path, j.data) |
| 91 | if err != nil { |
| 92 | log.WarnErrorf(err, "jodis create node %s failed", j.path) |
| 93 | j.watching = false |
| 94 | } else { |
| 95 | log.Warnf("jodis create node %s", j.path) |
| 96 | j.watching = true |
| 97 | } |
| 98 | return w, err |
| 99 | } |
| 100 | |
| 101 | func (j *Jodis) Start() { |
| 102 | j.mu.Lock() |
no test coverage detected