Skip to content

Commit c4fae4f

Browse files
author
Arnold Iakab
committed
Remove consumption stoppage when heartbeat error limit is reached
1 parent 93f1717 commit c4fae4f

File tree

1 file changed

+4
-13
lines changed

1 file changed

+4
-13
lines changed

connection.go

+4-13
Original file line numberDiff line numberDiff line change
@@ -158,20 +158,11 @@ func (connection *redisConnection) heartbeat(errChan chan<- error) {
158158

159159
errorCount++
160160

161-
if errorCount >= HeartbeatErrorLimit {
162-
// reached error limit
163-
connection.StopAllConsuming()
164-
// Clients reading from errChan need to see this error
165-
// This allows them to shut themselves down
166-
// Therefore we block adding it to errChan to ensure delivery
167-
errChan <- &HeartbeatError{RedisErr: err, Count: errorCount}
168-
return
169-
} else {
170-
select { // try to add error to channel, but don't block
171-
case errChan <- &HeartbeatError{RedisErr: err, Count: errorCount}:
172-
default:
173-
}
161+
select { // try to add error to channel, but don't block
162+
case errChan <- &HeartbeatError{RedisErr: err, Count: errorCount}:
163+
default:
174164
}
165+
175166
// keep trying until we hit the limit
176167
}
177168
}

0 commit comments

Comments
 (0)