refactor watcher.go

This commit is contained in:
Xiang Li
2013-10-07 22:17:58 -07:00
parent baaaf24f70
commit a71838a59b
6 changed files with 173 additions and 121 deletions

View File

@ -349,6 +349,9 @@ func (n *Node) Pair(recurisive, sorted bool) KeyValuePair {
func (n *Node) UpdateTTL(expireTime time.Time, s *Store) {
if !n.IsPermanent() {
// check if the node has been expired
// if the node is not expired, we need to stop the go routine associated with
// that node.
expired, _ := n.IsExpired()
if !expired {