Browse Source

server: stop timer when exit

Yicheng Qin 11 years ago
parent
commit
4b3c3203ff
1 changed files with 2 additions and 0 deletions
  1. 2 0
      etcd/participant.go

+ 2 - 0
etcd/participant.go

@@ -174,7 +174,9 @@ func (p *participant) run() int64 {
 
 	recv := p.rh.recv
 	ticker := time.NewTicker(p.tickDuration)
+	defer ticker.Stop()
 	v2SyncTicker := time.NewTicker(time.Millisecond * 500)
+	defer v2SyncTicker.Stop()
 
 	var proposal chan v2Proposal
 	var addNodeC, removeNodeC chan raft.Config