()
| 64 | } |
| 65 | |
| 66 | func (j *Jodis) Close() error { |
| 67 | j.mu.Lock() |
| 68 | defer j.mu.Unlock() |
| 69 | if j.closed { |
| 70 | return nil |
| 71 | } |
| 72 | j.closed = true |
| 73 | |
| 74 | if j.watching { |
| 75 | if err := j.client.Delete(j.path); err != nil { |
| 76 | log.WarnErrorf(err, "jodis remove node %s failed", j.path) |
| 77 | } else { |
| 78 | log.Warnf("jodis remove node %s", j.path) |
| 79 | } |
| 80 | } |
| 81 | return j.client.Close() |
| 82 | } |
| 83 | |
| 84 | func (j *Jodis) Rewatch() (<-chan struct{}, error) { |
| 85 | j.mu.Lock() |
nothing calls this directly
no test coverage detected