Commit d9488272 authored by hannahhoward's avatar hannahhoward

fix(sessions): consecutive ticks only when wants present

Don't count consecutive ticks if there are no active wants
parent 3104b2da
......@@ -314,10 +314,12 @@ func (s *Session) handleCancel(keys []cid.Cid) {
func (s *Session) handleTick(ctx context.Context) {
if s.fetchcnt == s.lastFetchCount {
s.consecutiveTicks++
} else {
s.lastFetchCount = s.fetchcnt
if len(s.liveWants) > 0 {
if s.fetchcnt == s.lastFetchCount {
s.consecutiveTicks++
} else {
s.lastFetchCount = s.fetchcnt
}
}
live := make([]cid.Cid, 0, len(s.liveWants))
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment